top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Mention the command to insert the following document in a database called school and collection called persons..?

+1 vote
70 views
Mention the command to insert the following document in a database called school and collection called persons..?
posted Mar 1, 2016 by Jishnu Ramachandran

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

Hi Jishnu I think question is incomplete but to insert any document with given details like you have,
Database Name: school and Collection name: persons
In mongoTerminal use code

use school;
db.persons.insert({"DataToInsertKey":"ValueOfData"}); 
answer Mar 1, 2016 by Shivam Kumar Pandey
Similar Questions
+1 vote

Query description: I have a collection name student_db and added a document in a collection with entries (name: "alok, age : 31 and profession: "xyz"). After inserting the document into student_db database, I want to add another (key:value ) pair i.e. salary: 50000.

Can someone help me out to resolve this problem ?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...