创建集合
POST/collections
创建新的集合(表),仅管理员权限可以创建集合。集合名称必须符合 MongoDB 命名规范。
Request
- application/json
Body
required
collectionName stringrequired
集合名称
Responses
- 201
- 400
- 409
集合创建成功
请求参数错误
- application/json
- Schema
- Example (from schema)
- Example
Schema
code string
错误码
message string
错误信息
request_id string
请求唯一 ID
{
"code": "INVALID_PARAM",
"message": "param.query can't be empty",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
{
"code": "INVALID_PARAM",
"message": "Collection name is required",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
集合已存在
- application/json
- Schema
- Example (from schema)
Schema
code string
错误码
message string
错误信息
request_id string
请求唯一 ID
{
"code": "INVALID_PARAM",
"message": "param.query can't be empty",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Loading...