Specifying $push Location In Collection Using Pymongo
I'm wondering how to use $push in a collection where I have to specify which document I want to add information to. Please consider the following example: student1 = { 'na
You are using the wrong update operator. What you need is the $set
update operator and the positional $
update operator.
db.collection.update_one(
{'class.className': 'cse131'},
{'$set': {'class.$.time': '3:30'}} # or {'class.$.status': 'pass'}
)
Post a Comment for "Specifying $push Location In Collection Using Pymongo"