0 votes
in MongoDB by
How do we perform sorting and Explain Project in MongoDB?

1 Answer

0 votes
by
For finding any data in MongoDB, we use the find() method. The discovery () method returns the collection’s documents over which we invoked this method. We can use the “Where” clause in the MongoDB query in order to restrict the output by using MongoDB projection. Anytime we execute the find() method, MongoDB returns all the documents associated with a particular collection.

db.<collection_name>.find({ }, {<key_Name>:<Flag to display>})

Related questions

0 votes
asked Jan 7, 2023 in MongoDB by sharadyadav1986
+1 vote
asked Aug 20, 2022 in MongoDB by Robin
...