跳到主要内容

查询文档列表

GET 

/collections/:collectionName/documents

查询集合中的文档列表,支持复杂查询条件(MongoDB 查询语法)、分页、排序和字段过滤。 当 count=true 时,仅返回符合条件的文档数量,不返回文档列表。

Request

Path Parameters

    collectionName stringrequired

    集合名称

Query Parameters

    query string

    Default value: {}

    查询条件(EJSON 字符串),如 {"age":{"$gte":18}}

    offset integer

    Default value: 0

    偏移量(分页)

    limit integer

    Default value: 20

    每页数量

    order string

    排序规则(JSON 字符串),如 [{"field":"age","direction":"desc"}]

    projection string

    字段过滤(JSON 字符串),如 {"name":1,"email":1}

    count boolean

    设置为 true 时仅返回文档数量

    transactionId string

    事务 ID

Responses

查询成功

Schema
    oneOf
    offset integer

    当前偏移量

    limit integer

    每页数量

    list object[]

    文档列表(EJSON 格式)

Loading...