Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

updating an array of object in mongoose

Person.update(
   {
     _id: 5,
     grades: { $elemMatch: { grade: { $lte: 90 }, mean: { $gt: 80 } } }
   },
   { $set: { "grades.$.std" : 6 } }
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #updating #array #object #mongoose
ADD COMMENT
Topic
Name
1+5 =