Retrieve documents in MongoDB collection
returns all documents in a collection by using the MongoDB® connection.documents
= find(conn
,collection
)
specifies additional options using one or more name-value pair arguments. For
example, documents
= find(conn
,collection
,Name,Value
)'Limit',10
limits the number of documents returned to
10.
The find
function estimates memory requirements when
retrieving many documents using the Java® heap. To avoid out-of-memory issues, the function automatically
limits the number of returned documents in a single execution.
When an issue occurs, the function throws a warning message, for example,
Warning: Available memory is less than Total memory required.
Limiting the RESULTSET from 15837001 to 59248. Use Skip and Limit to
retrieve resultset in batches
.
To retrieve many documents, retrieve them in batches. For an example, see Import Large Data from MongoDB.