MongoDB Query Document
Use db.collection.find() method to query collection for available documents. You can use the show collections command to view the available collections in your database.
Syntax
Search All Documents
Execute find() function on the collection without any condition to get all the available documents in the collection.
You can also use pretty() function with the above command to show formatted output.
Output
Search Specific Documents
You can define conditions to select documents that matches the specified condition.
The above command will show all the fields from the document having {"id": 1001}
.
0 Comments
CAN FEEDBACK
Emoji