Update document requires atomic operators

This is incorrect syntax. You want to have both of your matches in a single set of curly brackets.

Try

db.zips.updateMany(
    {
        "city": "ALBANY",
        "state": "NY"
    },
    {
        "$set": {
            "capital?": true
        }
    }
)
1 Like