DEV Community

Rittwick Bhabak
Rittwick Bhabak

Posted on

#10 Deleting Record

Mongoose has 3 records to delete records

  • char.remove()
  • MarioChar.remove() Inside the bracket we are going to pass the options
  • MarioChar.findOneAndRemove() Inside the bracket we're going to pass the options

Use of findOneAndRemove()

MarioChar.findOneAndRemove({ name:"Mario" }).then(function(){
            MarioChar.findOne({ name:"Mario" })
        })
Enter fullscreen mode Exit fullscreen mode

Top comments (0)