Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

mongodb update

db.collectionName.update({"aField":"vale1"},{$set:{"anotherField":"value2"}})

-search for documentations for more examples than search
-aField is used to find the documents
-anotherField is the field that will be updated
-You can also use the below:
-- updateOne
-- findOneAndUpdate
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #mongodb #update
ADD COMMENT
Topic
Name
1+8 =