Need IDE assistance

Need help with the IDE challenge. Used the following command:

db.zips.update({“state”:“NY”,“city”:“ALBANY”},{"$set":{“capital?”:“true”}},{“state”:“NY”,“city”:“New York”},{"$set":{“capital?”:“false”}})

Error message: Error: Fourth argument must be empty when specifying upsert and multi with an object.

The template for update method is:

db.coll.update(<query>, <update>, <options>)

Looking at your post, this is being issued

db.coll.update(<query>, <update>, <query>, <update>)

So it’s sending an error about the fourth argument. That shouldn’t be there.

Now, one way to achieve what you look for is using 2 separate updates.

I won’t spoil the fun :slight_smile:


Hi @Lucas_Strick,

Let us know if you are still facing any issues.

~ Shubham