shanahobo86
shanahobo86

Reputation: 497

syntax error using mongo-db updateMany query

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

Answers (1)

bergerg
bergerg

Reputation: 995

You got the syntax wrong...

db.fixtures.updateMany({"competition": "League Division 1"}, {"set":{"comp_id":"5c65d916456b5d0e207778ac"}})

Upvotes: 1

Related Questions