Home/Documentation

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

OperatorMeaningExample
eq (default)Equals?filter[status]=active
neqNot equals?filter[status][neq]=archived
gtGreater than?filter[age][gt]=18
gteGreater or equal?filter[age][gte]=21
ltLess than?filter[price][lt]=100
lteLess or equal?filter[price][lte]=99.99
containsString contains (case-insensitive)?filter[name][contains]=alice
inValue in list?filter[status][in]=active,pending
existsField 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

NameTypeDescription
sortstringField 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

NameTypeDescription
limitnumberPage size (default: 20, max: 50 Free / 100 Pro)
offsetnumberNumber of documents to skip (default: 0)

Response format

{
  "data": [ ... ],
  "meta": {
    "total": 42,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}

Field Selection

Query Parameters

NameTypeDescription
selectstringComma-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

NameTypeDescription
countbooleanSet 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.