The error says it all: you can only change a few documents using the $ modifier operators. You probably had something like this:
> db.coll.update({ }, { a: 'b' }, false, true);
Which usually replaces the first object in the collection with { a: 'b' } if multi was false. You will not want to replace all objects in your collection with the same document!
Use the $set operator instead:
> db.coll.update({ }, { '$set': { a: 'b' } }, false, true);
This will create a property of each document (if necessary, create it) before 'b' .
Cameron Apr 7 2018-11-11T00: 00Z
source share