VOOZH about

URL: https://www.geeksforgeeks.org/python/get-all-the-documents-of-the-collection-using-pymongo/

⇱ Get all the Documents of the Collection using PyMongo - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Get all the Documents of the Collection using PyMongo

Last Updated : 15 Jul, 2025

To get all the Documents of the Collection use find() method. The find() method takes a query object as a parameter if we want to find all documents then pass none in the find() method. To include the field in the result the value of the parameter passed should be 1, if the value is 0 then it will be excluded from the result. Note: If we pass no parameter in find() method .it works like select * in MYSQL . Sample Database: Let’s suppose the database looks like this πŸ‘ Image
Example 1: 

Output: πŸ‘ Image
Example 2: 

Output: πŸ‘ Image

Comment
Article Tags: