Mongodb Classroom image

Anil  Bist / Professional / DataBase

 
To post your Question Join Classroom
 
Lesson Topics's No:-  ||
Lessons:-Hello World

Hello World

After installation process, the following lines should be entered in mongo shell (client terminal).

> db.world.insert ({ "speech" : "Hello World!" });
> cur = db. world.find ();x=cur.next();print(x [ "speech" ] );

 

Hello World! 

Explanatio

  • In the first line, we have inserted a  { key : value }  paired document in the default database test  and in the collection named  world
  • In the second line we retrieve the data we have just inserted. The retrieved data is kept in a javascript variable named  cur. Then by the  next() function, we retrieved the first and only document and kept it in another js variable named x. Then printed the value of the document providing the key.
 
 
 
image
Anil  Bist

Skills    Mongodb

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

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)