Skip to main content

Query Document List

GET 

/collections/:collectionName/documents

Query documents in a collection. Supports complex query conditions (MongoDB query syntax), pagination, sorting, and field projection. When count=true, only returns the count of matching documents without the document list.

Request

Path Parameters

    collectionName stringrequired

    Collection name

Query Parameters

    query string

    Default value: {}

    Query conditions (EJSON string), e.g. {"age":{"$gte":18}}

    offset integer

    Default value: 0

    Offset for pagination

    limit integer

    Default value: 20

    Number of documents per page

    order string

    Sort rules (JSON string), e.g. [{"field":"age","direction":"desc"}]

    projection string

    Field projection (JSON string), e.g. {"name":1,"email":1}

    count boolean

    Set to true to return only the document count

    transactionId string

    Transaction ID

Responses

Query successful

Schema
    oneOf
    offset integer

    Current offset

    limit integer

    Documents per page

    list object[]

    Document list (EJSON format)

Loading...