Reputation: 497
I can't figure this one out. Trying to add a field in all documents where a field matches the expression.
Am trying various combinations of the below updateMany query:
db.fixtures.updateMany({"competition": "League Division 1"}, $set{"comp_id":"5c65d916456b5d0e207778ac"})
Keep getting this error:
SyntaxError: missing ) after argument list @(shell):1:65
Can someone please put me out of my misery and tell me what I'm doing wrong so I can enjoy the rest of my Sunday!
Thanks
Upvotes: 0
Views: 229
Reputation: 995
You got the syntax wrong...
db.fixtures.updateMany({"competition": "League Division 1"}, {"set":{"comp_id":"5c65d916456b5d0e207778ac"}})
Upvotes: 1