Answer the question
In order to leave comments, you need to log in
How to set the same value to the ObjectID array?
There is an array of ObjectID. I want to change a certain field in every object. I would not like to write a crutch, maybe there is an elegant solution?
Answer the question
In order to leave comments, you need to log in
MyCollection.update({ _id: { $in: objectIdArray } }, {$set: {my_field: 'some new value'}}).then(console.log.bind(console))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question