Find Many
AI-generatedSummary
Retrieve multiple documents from a specified MongoDB database and collection, filtered by query fields, optionally sorted and limited in number.
Inputs
- Database (required) — The name of the MongoDB database to query.
- Collection (required) — The MongoDB collection name to search in.
- Query — Key-value pairs to filter documents; supports multiple fields and types like string, number, boolean, datetime, and UUID.
- Limit — Maximum number of documents to return, defaulting to 100. Must be at least 1.
- Sort — A JSON object defining the sort order for the results, for example {"createdAt": -1} to sort descending by creation date.
Output shape
a list of JSON objects representing MongoDB documents that match the query filters
The returned documents respect the optional limit and sort parameters. If no documents match, an empty list is returned. Errors during execution may be included per-item if 'continue on fail' is enabled.
Examples
Example 1: Fetch up to 50 users from 'users' collection filtered by 'status' as 'active' and sorted by 'lastLogin' descending
Database: specified database, Collection: 'users', Query: [{key:'status', type:'string', value:'active'}], Limit: 50, Sort: {"lastLogin": -1}