Hello,
I am trying to go through the examples at the end of Chapter 3 of M001, MongoDB Basics using the in browser IDE and I can’t get the updateMany() command to work.
Here is the command and the error that I get:
MongoDB Enterprise atlas-ll7v9s-shard-0:PRIMARY> db.zips.updateMany(
… { “city”: “ALBANY” },
… {“state”: “NY”},
… { “$set”: { “capital”: true } },
… { upsert: true })
uncaught exception: Error: the update operation document must contain atomic operators :
DBCollection.prototype.updateMany@src/mongo/shell/crud_api.js:655:19
@(shell):1:1
I that that $set is an atomic operator so I’m not sure what I’m doing wrong.
Any help would be much appreciated!
Thanks!