Click here to Skip to main content
Click here to Skip to main content

Tagged as

mongodb find documents in a collection

, 16 Oct 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
mongodb find documents in a collection
In MongoDB, you can use find method to perform queries as follows:
Create the document collections
 
>  employee = ({"ecode": "E101", "ename": "mahesh"})
>  db.Employees.insert(employee)
>  employee = ({"ecode": "E102", "ename": "nimesh"})
>  db.Employees.insert(employee)
Find command
 
The find method is used to perform the queries in MongoDB. find() method returns everything in the collection as follows:
 
> db.Employees.find()
 
Other Mongodb Tutorials

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

A Mahesh
Web Developer
India India
Symphony Services, Banglore, 560 087, India
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 16 Oct 2011
Article Copyright 2011 by A Mahesh
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid