Tuesday, December 26, 2017

Mongo Database - Day 33

CURD operation is one of the main operation used in Database.
C -Create
U - Update
R - Read
D - D 

The basic syntax of update() method is as follows >db.COLLECTION_NAME.update(SELECTION_CRITERIA, UPDATED_DATA)
Following example will set the new title 'Parathan' of the documents whose title is 'Jaffna'.

>db.mycol.update({'title':'Jaffna'},{$set:{'title':'Parathan'}})

No comments:

Post a Comment