query_collection
Query data from collections using URL-style, regex, or MongoDB-style JSON queries. Supports system collections like '_hooks' to discover API endpoints and deployment metadata.
Instructions
Query data from a collection. Supports URL-style, regex, and MongoDB-style JSON queries with comparison operators. Can also query system collections like '_hooks' which contains deployment metadata including available API endpoints. Using delete, update or replace is very powerful but also dangerous, so use with caution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | Collection name. Use '_hooks' to query deployment metadata and discover available API endpoints. | |
| query | No | Query expression. Supports multiple formats: URL-style ('name=Polly&type=Parrot'), regex ('name=/^po/'), or MongoDB-style JSON ('{"name": "Polly", "age": {"$gt": 5}}' for complex queries with operators like $gt, $lt, $gte, $lte, $ne, $in, $nin, $exists, $regex). To get the latest deployment info with API endpoints, use: collection='_hooks', limit=1, reverse=true (check the routehooks property for the available API endpoints) | |
| count | No | Count query results | |
| delete | No | Delete all items from query result | |
| update | No | Patch all items from query result with JSON string '{...}' | |
| replace | No | Replace all items from query result with JSON string '{...}' | |
| useindex | No | Use an indexed field to scan data in query | |
| start | No | Start value for index scan | |
| end | No | End value for index scan | |
| limit | No | Limit query result. Use limit=1 and reverse to get latest deployment from _hooks collection | |
| fields | No | Comma separated list of fields to include | |
| sort | No | Comma separated list of fields to sort by. Use '_id' to sort by creation time | |
| offset | No | Skip items before returning data in query result | |
| enqueue | No | Add query result to queue topic | |
| reverse | No | Scan index in reverse order. Use with sort='_id' to get newest records first | |
| csv | No | Output data in CSV format | |
| jsonl | No | Output data in JSONL format |