Mongodb Classroom image

Anil  Bist / Professional / DataBase
 
To post your Question Join Classroom
 
Lesson Topics's No:-  |1 | 2|Last
Lessons:-Update Operators

Update Operators

parameters       Meaning
fieldName      Field will be updated :{name: 'Tom'}
targetVaule      Value will be assigned to the field :{name: 'Tom'}

 

$set operator to update specified field(s) in document(s)

I.Overview

A significant difference between MongoDB & RDBMS is MongoDB has many kinds of operators. One of them is update operator, which is used in update statements.

II.What happen if we don't use update operators?

Suppose we have a student collection to store student information(Table view):

 

 

One day you get a job that need to change Tom's gender from "M" to "F". That's easy, right? So you write below statement very quickly based on your RDBMS experience:

 

 
 
 
image
Anil  Bist

Skills    Mongodb

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (0)