Skip to main content

Execute Database Commands

POST 

/commands

Execute MongoDB native database commands in batch. All commands are executed sequentially and return a corresponding result array. Supports transaction execution.

Only administrator permissions can invoke this endpoint.

Common commands include: find, insert, update, delete, aggregate, createIndexes, etc.

Request

Body

required
    commands object[]required

    Array of MongoDB native commands, each element is an EJSON object

    transactionId string

    Transaction ID (execute all commands within the transaction)

Responses

Commands executed successfully

Schema
    list array[]

    2D EJSON array, list[i] corresponds to the result of commands[i]

Loading...