Learn Python

Learn Data Structure & Algorithm

Learn Numpy

Learn Pandas

Learn Matplotlib

Learn Seaborn

Learn Statistics

Learn Math

Learn MATLAB

Learn Machine learning

Learn Github

Learn OpenCV

Learn Deep Learning

Learn MySQL

MongoDB Introduction

MongoDB Setup

MongoDB DataBase

MongoDB Insert Data

MongoDB Read Document

MongoDB Update

MongoDB Delete

MongoDB Sorting Index

MongoDB Aggregation

MongoDB Mongodb with python

Learn Web scraping

Learn Excel

Learn Power BI

Learn Tableau

Learn Docker

Learn Hadoop

MongoDB update

How to update document?

Suppose you have a data base name first collection. In the collection, you have keys like Name and price. In the name, you have values python, java, javascript, sql, etc.

Update one document:
Syntax:
db.COLLECTION_NAME.updateOne(filter,update)

Example:
db.first_collection.updateOne({name:"python"},{$set:{Price:600}})

Update multiple document:
Syntax:
db.COLLECTION_NAME.updateMany(filter,update)

Example:
db.first_collection.updateMany({name:"Javascript"},{$set:{Price:600}})

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.