Find Update and Remove Data from MongoDB

Find Update and Remove Data from MongoDB

Find Update and Remove Data from MongoDB

Find Update and Remove Data from MongoDB

In this Article i will show you how to mess around with MongoDB DataBase

  1. Find
  2. Update
  3. Remove

 

Finding Data

  • db.product.find({“productName” :”Donut”})
  • Use the find() method and type in the Keyword and the field data that you want to find

Update Data

  • In Order to update the Data Field , first you will need to find the data first
  • After you have found your data set the Data Field that you want to Update
  • db.product.update({“productName”:”Donut”},{$set:{“Price”:4.99}})

Remove Data

  • db.product.remove({“productName”:”Donut”})

Check out MogoDB Documentation Here

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

eighteen − five =