Filip
0
Q:

mongoose updatemany example

// Update the document using `updateOne()`
await CharacterModel.updateOne({ name: 'Jon Snow' }, {
  title: 'King in the North'
});

// Load the document to see the updated value
const doc = await CharacterModel.findOne();
doc.title; // "King in the North"
-1
User.update({"created": false}, {"$set":{"created": true}}, {"multi": true}, (err, writeResult) => {});
0
var conditions = { name: 'bourne' } 
  , update = { $inc: { visits: 1 }}

Model.update(conditions, update, { multi: true }).then(updatedRows=>{
  
}).catch(err=>{
  console.log(err)
  
})
0

New to Communities?

Join the community