188,560 views
8 votes
8 votes
To locate all the documents in a Mongo database that match an expression, use the _____________ method.

User Urchboy
by
2.8k points

1 Answer

17 votes
17 votes

Answer:

find()

Step-by-step explanation:

When dealing with MongoDB the method that needs to be used in this scenario would be the find() method. This method basically returns all of the records that exist in the collection on which it is called, if no parameter is passed. If you pass a parameter/expression then only the records that match completely the expression will be returned to the user, otherwise nothing is returned. For example, on a database (db) we would call the following

db.find() ... This will return all records

db.find({specific}) ... This will return only the records that match specific.

User Altug
by
2.9k points