Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update and fetch the new records in mongoose

//                                                         V--- THIS WAS ADDED
Cat.findOneAndUpdate({age: 17}, {$set:{name:"Naomi"}}, {new: true})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #fetch #records #mongoose
ADD COMMENT
Topic
Name
5+5 =