Answers for "mongodb update in me"

1

how to update date in mongodb

db.<collections-name>.update({name:"A"},{$set(name:"B")})
                      //       old name        new name
Posted by: Guest on December-17-2021
4

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
Posted by: Guest on December-12-2020

Browse Popular Code Answers by Language