Execute Database Commands
POST/commands
Execute MongoDB-style database commands in batch. All commands are executed sequentially and return a corresponding result array. Supports transaction execution.
Only administrators and CloudBase OpenAPI can invoke this endpoint.
Common commands include: find, insert, update, delete, aggregate, createIndexes, etc.
Unsupported Commands
The following commands are no longer supported and return an error when invoked:
| Unsupported Command | Alternative |
|---|---|
group | Use the $group stage of aggregate |
geoNear | Use the $geoNear stage of aggregate |
eval | Run the logic in the application layer |
copydb, clone | Read data with find, then write to the target collection with insert |
cloneCollection | Deprecated; use find + insert instead |
repairDatabase | No alternative; contact technical support to rebuild indexes |
getPrevError | No alternative |
parallelCollectionScan | No alternative |
In addition, the find command no longer supports the maxScan option. Use maxTimeMS instead.
Request
Responses
- 200
- 400
Commands executed successfully
Invalid request parameters