Check out example codes for "pymongo update". It will help you in understanding the concepts better.

Code Example 1

import pymongo

myclient = pymongo.MongoClient("mongodb://localhost:27017/")

  mydb = myclient["mydatabase"]
mycol = mydb["customers"]

  
myquery = { "address": "Valley 345" }
newvalues = { "$set": { 
  "address": "Canyon 123" } }

  
mycol.update_one(myquery, newvalues)

#print "customers" after the update:
for x in mycol.find():
  print(x)

Learn ReactJs, React Native from akashmittal.com