My scrapbook about almost anything I stumble upon but mostly around Cloud, K8s, OpenShift, DataScience, Machine Learning, Golang, Python, Data Analytics, DataStage, DWH and ETL Concepts. If you find any pages useful don't forget to give thumbs-up :)


Wednesday, January 2, 2019

MongoDB with Python - Basics IV - Update & Delete Operation

Welcome to one more quick session on MongoDB CRUD Basics with Update and Delete Operations. MDB Provides below methods under these operations -

** Update
      * update_one
      * update_many
      * replace_one

** Delete
      * delete_one
      * delete_many

For on Mongo DB -> Link

As it is quite clear from the name itself (_one and _many) that these methods perform the operation on single or multiple records based on the passed condition.
There are so many operator supported by update statement, few are as below -

$set - Add new or update field value
$unset  - Remove field
$inc - increment the current value
$push - push element into array field
$push with $each - push multiple elements into array field
$pop - pull out last value from array field

There are many more Update operators support by MongoDB, Full list can be found HERE

CRUD Operation - (Update & Delete) : Link

Like the below page to get the update  
Facebook Page      Facebook Group      Twitter Feed      Google+ Feed      Telegram Group     


The postings on this site are my own and don't necessarily represent IBM's or other companies positions, strategies or opinions. All content provided on this blog is for informational purposes and knowledge sharing only.
The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of his information.