Querying
Filter, sort, paginate, and select fields using URL query parameters. No query language to learn.
GET
/v1/db/{ns}/{collection}List and query documents in a collection.
Filtering
Use filter[field]=value to filter documents. Multiple filters combine with AND logic.
Operators
| Operator | Meaning | Example |
|---|---|---|
eq (default) | Equals | ?filter[status]=active |
neq | Not equals | ?filter[status][neq]=archived |
gt | Greater than | ?filter[age][gt]=18 |
gte | Greater or equal | ?filter[age][gte]=21 |
lt | Less than | ?filter[price][lt]=100 |
lte | Less or equal | ?filter[price][lte]=99.99 |
contains | String contains (case-insensitive) | ?filter[name][contains]=alice |
in | Value in list | ?filter[status][in]=active,pending |
exists | Field exists | ?filter[email][exists]=true |
# Active users over 18
curl "https://api.jsondb.cloud/v1/db/default/users?filter[status]=active&filter[age][gt]=18" \
-H "Authorization: Bearer YOUR_API_KEY"
# Nested field with dot notation
curl "https://api.jsondb.cloud/v1/db/default/users?filter[address.city]=Berlin" \
-H "Authorization: Bearer YOUR_API_KEY"Sorting
Query Parameters
| Name | Type | Description |
|---|---|---|
sort | string | Field name to sort by. Prefix with - for descending (e.g. -createdAt) |
# Sort by name ascending
curl "https://api.jsondb.cloud/v1/db/default/users?sort=name" \
-H "Authorization: Bearer YOUR_API_KEY"
# Sort by creation date descending
curl "https://api.jsondb.cloud/v1/db/default/users?sort=-_createdAt" \
-H "Authorization: Bearer YOUR_API_KEY"Pagination
Query Parameters
| Name | Type | Description |
|---|---|---|
limit | number | Page size (default: 20, max: 50 Free / 100 Pro) |
offset | number | Number of documents to skip (default: 0) |
Response format
{
"data": [ ... ],
"meta": {
"total": 42,
"limit": 20,
"offset": 0,
"hasMore": true
}
}Field Selection
Query Parameters
| Name | Type | Description |
|---|---|---|
select | string | Comma-separated field names. _id is always included. |
# Only return name and email
curl "https://api.jsondb.cloud/v1/db/default/users?select=name,email" \
-H "Authorization: Bearer YOUR_API_KEY"Count
Query Parameters
| Name | Type | Description |
|---|---|---|
count | boolean | Set to 'true' to return only the count, no documents. |
curl "https://api.jsondb.cloud/v1/db/default/users?filter[status]=active&count=true" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response: { "count": 42 }info
Query limits
Free tier: max 5 filters, limit up to 50, offset up to 1,000. Pro tier: max 20 filters, limit up to 100, offset up to 50,000.