#56 Update documents in a collection | Getting Started with MongoDB | A Complete NODE JS Course

preview_player
Показать описание
We learned how to insert and fetch documents from a collection. In this lecture, let's learn how to update an existing document in a collection. For updating documents, we have two methods:

* updateOne() - updates one document at a time
* updateMany() - updates multiple documents at a time

These two methods are supported by all major drivers available for MongoDB.
Рекомендации по теме
Комментарии
Автор

Thank you sir for this valuable playlist, do I have to do anything else for backend except this playlist?

rajandubey
Автор

Hello Sir, i have a doubt here, say for example, we have 4documents having name john, and i wanted to update only the second document with name john, remanining three should be same, is it possible.

meenadurgakml
Автор

Is it possible to update a document to remove a key? For example: update {name: "john", age: 32, gender: "male"} to {name: "john, age:32}

michelnunes