# Generated by ShowAPI OpenAPI generator
# source: market/1867
# generated-at: 2026-06-26T01:57:28.630Z
openapi: 3.0.3
info:
  title: MongoDB的HTTP接口
  description: 本接口是一款专为 MongoDB 数据库设计的 RESTful 风格的数据服务。它旨在简化应用程序与 MongoDB 之间的数据交互，允许开发者通过标准的 HTTP/HTTPS GET 和 POST 请求，快速、安全地执行各种数据库操作，而无需深入编写复杂的数据库驱动代码或管理数据库连接。
  termsOfService: https://www.showapi.com/helpcenter/view#/4019/2
  version: 1.0.0
servers:
  - url: https://route.showapi.com
paths:
  /1867-13:
    x-pointCode: 13
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: inc
      description: 更新一条记录
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 返回0表示成功
                        description: 业务返回体
      operationId: 1867_13_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: string
                  description: 查询条件
                updata:
                  type: string
                  description: 将某个字段增加或减少。比如{"age":1}是将age字段+1。如果是{"age":-10}，表示将age字段减10
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - query
                - updata
                - ds_id
  /1867-12:
    x-pointCode: 12
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: search-pagebean
      description: 分页查询
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          allNum:
                            type: number
                            description: 总条数
                          contentlist:
                            type: array
                            items:
                              type: object
                              properties:
                                "0":
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                    name:
                                      type: string
                                    ct:
                                      type: string
                            description: 返回的数据,是一个对象数组
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 返回0表示成功
                          currentPage:
                            type: number
                            description: 当前页
                          allPages:
                            type: number
                            description: 总的有几页
                          maxResult:
                            type: string
                            description: 每页最大结果数
                        description: 业务返回体
      operationId: 1867_12_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: string
                  description: 查询条件
                fields:
                  type: string
                  description: 需要展示的字段
                orderby:
                  type: string
                  description: 需要根据哪些字段排序
                page:
                  type: number
                  description: 返回第几页的数据
                pageSize:
                  type: number
                  description: 每页展示的最大条数
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - query
                - ds_id
  /1867-11:
    x-pointCode: 11
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: aggregate
      description: 聚合函数
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          list:
                            type: array
                            items:
                              type: object
                              properties:
                                "0":
                                  type: object
                                  properties:
                                    _id:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                      description: 根据哪些字段分组
                                    i:
                                      type: number
                                      description: 聚合后的结果
                            description: 返回结果
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 当返回为0时表示成功
                        description: 业务返回体
      operationId: 1867_11_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: object
                  description: 查询条件
                project:
                  type: object
                  description: 参与聚合函数的字段
                group:
                  type: object
                  description: 根据指定的字段分组
                orderby:
                  type: object
                  description: 根据聚合后的结果中的字段排序后返回
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - query
                - project
                - group
                - orderby
                - ds_id
  /1867-10:
    x-pointCode: 10
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: find-sum
      description: 指定字段求和
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          ret:
                            type: object
                            properties:
                              num:
                                type: number
                                description: 求和的对应字段和对应的值(只能对数字类型的字段求和)
                            description: 返回的参数
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 返回0时表示成功
                        description: 业务返回体
      operationId: 1867_10_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: object
                  description: 什么条件的记录参与求和
                fields:
                  type: array
                  items: {}
                  description: 需要展示的字段
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - query
                - ds_id
  /1867-9:
    x-pointCode: 9
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: find-distinct
      description: 查询指定字段的不重复值
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          stats:
                            type: object
                            properties:
                              nscanned:
                                type: number
                              timems:
                                type: number
                              n:
                                type: number
                              cursor:
                                type: string
                              nscannedObjects:
                                type: number
                                description: 参与去重的条数
                          remark:
                            type: string
                          values:
                            type: object
                            properties:
                              "0":
                                type: string
                                description: 指定字段去重后的值
                          ok:
                            type: number
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_9_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                key:
                  type: string
                  description: 去重字段
                query:
                  type: string
                  description: 查询条件
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - key
                - ds_id
  /1867-8:
    x-pointCode: 8
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: insert
      description: 插入一条记录
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          new_obj:
                            type: object
                            properties:
                              _id:
                                type: string
                                description: 插入记录的_id,该值在表中唯一
                              name:
                                type: string
                              ct:
                                type: string
                                description: 插入记录的时间
                            description: 插入对象的数据结构
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 为0是表示插入成功
                        description: 业务返回体
      operationId: 1867_8_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
                collection:
                  type: string
                  description: 表名
                new_obj:
                  type: string
                  description: 插入的新对象,也即保存新对象。new_obj是json的to_string形式。
              required:
                - ds_id
                - collection
                - new_obj
  /1867-7:
    x-pointCode: 7
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: drop-table
      description: 删除一个集合
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          remark:
                            type: string
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_7_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                table:
                  type: string
                  description: 要删除的collection名称
                ds_id:
                  type: string
                  description: 数据源
              required:
                - table
                - ds_id
  /1867-6:
    x-pointCode: 6
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: update
      description: 修改一条记录
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          ret_code:
                            type: number
                            description: 返回为0时表示成功
                          remark:
                            type: string
                          set_obj:
                            type: object
                            properties:
                              name:
                                type: string
                            description: 更新的字段
                          query_obj:
                            type: object
                            properties:
                              _id:
                                type: string
                            description: 查询条件
                        description: 业务返回体
      operationId: 1867_6_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
                collection:
                  type: string
                  description: 表名
                query_obj:
                  type: object
                  description: 要更新谁。是json的to_string形式。
                set_obj:
                  type: object
                  description: 需要更新的属性新值，不在此列的属性则不动。是json的to_string形式。
              required:
                - ds_id
                - collection
                - query_obj
                - set_obj
  /1867-5:
    x-pointCode: 5
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: del
      description: 删除一条记录
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          query:
                            type: object
                            properties:
                              _id:
                                type: string
                            description: 查询条件
                          remark:
                            type: string
                          ret_code:
                            type: number
                            description: 为0时表示成功
                        description: 业务返回体
      operationId: 1867_5_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
                collection:
                  type: string
                  description: 表名collection
                query:
                  type: string
                  description: 需要删除对象的查询条件，比如{"_id":"123"}
              required:
                - ds_id
                - collection
                - query
  /1867-4:
    x-pointCode: 4
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: list-table
      description: 查询集合名称列表
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          list:
                            type: array
                            items:
                              type: string
                            description: 当前数据库中的表名
                          remark:
                            type: string
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_4_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
              required:
                - ds_id
  /1867-3:
    x-pointCode: 3
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: find-count
      description: 查询满足条件的记录条数
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          remark:
                            type: string
                          num:
                            type: number
                            description: 满足条件的条数
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_3_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: string
                  description: 查询条件
                ds_id:
                  type: string
                  description: 数据源
              required:
                - collection
                - query
                - ds_id
  /1867-2:
    x-pointCode: 2
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: find-list
      description: |-
        核心功能：从 MongoDB 集合中查询 符合条件的多条记录，支持 查询过滤、字段裁剪、排序规则、结果条数限制，满足列表数据获取、批量数据筛选等场景。适用场景：
        数据列表展示（如用户列表、订单列表）；
        批量数据提取（如导出符合条件的记录）；
        带排序的批量查询（如按时间倒序的最近 10 条日志）。
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          list:
                            type: array
                            items:
                              type: object
                              properties:
                                "0":
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      description: 此条记录的id,_id在当前表中唯一
                                    name:
                                      type: string
                                    ct:
                                      type: string
                                      description: 该调记录的插入时间
                            description: 返回的数据
                          remark:
                            type: string
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_2_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
                collection:
                  type: string
                  description: 集合名称
                query:
                  type: string
                  description: 查询条件, 是json的to_string形式。
                fields:
                  type: string
                  description: 需要返回的字段.  fields 是json的to_string形式。
                orderby:
                  type: string
                  description: 排序条件，例如：{"_id":-1}表示使用_id逆序排序。
                limit:
                  type: number
                  minimum: 2
                  maximum: 10000
                  description: 返回的最大条目数。
              required:
                - ds_id
                - collection
                - query
  /1867-1:
    x-pointCode: 1
    x-mode: mapping
    x-read-timeout: 5
    x-connect-timeout: 5
    post:
      summary: find-one
      description: 核心功能：从 MongoDB 集合中查询 符合条件的单条记录，支持查询条件过滤、字段裁剪、排序规则，精准获取目标数据。适用场景：单条数据精准查询（如用户详情、订单详情）、带排序的首条记录（如最新日志、最近订单）等。
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          ret:
                            type: object
                            properties:
                              _id:
                                type: string
                                description: 此条记录的id,_id在当前表中唯一
                              name:
                                type: string
                              ct:
                                type: string
                                description: 此条记录的插入时间
                            description: 返回的数据
                          remark:
                            type: string
                          ret_code:
                            type: number
                        description: 业务返回体
      operationId: 1867_1_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ds_id:
                  type: string
                  description: 数据源
                collection:
                  type: string
                  description: 需要查找的集合名称
                query:
                  type: string
                  description: 查询条件, 是json的to_string形式。
                fields:
                  type: string
                  description: 需要返回的字段.  fields 是json的to_string形式。
                orderby:
                  type: string
                  description: 根据某字段进行排序,设置之后是将所有满足条件的记录根据该字段排序,然后取取第一条返回
              required:
                - ds_id
                - collection
                - query
components:
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: appKey
      description: 从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp
  schemas:
    ShowapiResEnvelope:
      type: object
      description: ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）
      properties:
        showapi_res_code:
          type: integer
          description: API 返回的状态码
        showapi_res_error:
          type: string
          description: API 返回的错误信息
        showapi_res_id:
          type: string
          description: API 请求的唯一标识
        showapi_fee_num:
          type: integer
          description: API 调用计费次数
security:
  - AppKeyAuth: []
externalDocs:
  url: https://www.showapi.com/apiGateway/view/1867?tab=book
x-apiCode: "1867"
x-is-own: false
x-is-op: true
