
上QQ阅读APP看书,第一时间看更新
The read operation
The read operation retrieves documents or data from documents in the collection. To retrieve all documents from a given collection, pass an empty document as a filter. We have to pass the query filter parameter in order to apply our criteria for the selection of documents:

The preceding code returns all the documents in the given collection:

This operation will return all the documents from the user_profiles collection. It is also equivalent to the following SQL operation, where user_profiles is the table, and the query will return all the rows from the table:
SELECT * FROM user_profiles;