DEV Community

loading...

#10 Deleting Record

rittwickbhabak profile image Rittwick Bhabak ・1 min read

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

Discussion (0)

pic
Editor guide