0 votes
1.7k views
in MongoDB by
How to insert data into mongodb ?

1 Answer

0 votes
by

Mongodb provids us insert() method to insert data into given or selected collection:


> db.employee.insert({ firstName:"Ranju", lastName:"Kumar", empCode:100011, empSal:10000 })
> show collections
employee
system.indexes
> db.employee.find()
{ "_id" : ObjectId("52ca3533acdc6a551445de70"), "firstName" : "Ranju", "lastName" : "Kumar", "empCode" : 100011, "empSal" : 10000 }
>
 

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...