Friday 4 June 2021

Mongo shell: fetch all the documents from collection

‘find’ method is used to fetch all the documents from the collection.

> db.employee.find()
{ "_id" : ObjectId("60ba0a678e67ad0ff5b02998"), "id" : 1, "name" : "Krishna", "age" : 32, "designation" : "Architect" }
{ "_id" : ObjectId("60ba0b278e67ad0ff5b02999"), "id" : 34, "name" : "Anand", "age" : 42, "designation" : "Manager" }

 

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment