Skip to main content

Execute MongoDB Command

Synopsis

在MongoDB建成运行一个用户指定的命令nce.

Description

This operator can be used to execute arbitrary MongoDB commands. Commands are specified and results returned via JSON/BSON documents. For instance, the command {"create": "myCollection"} creates a new collection of the name "myCollection".

Input

command

The database command to be executed (a JSON/BSON document). Alternatively, you can specify this document via the command parameter. Note that this parameter is only visible if no document is connected to the input port.

connection

This input port expects a Connection object if any. See the parameterconnection entryfor more information.

Output

result

The document containing the results of the MongoDB database command.

connection

This output port delivers the Connection object from the input port. If the input port is not connected the port delivers nothing.

Parameters

Connection source

This parameter indicates how the connection should be specified. It gives you two options, predefined and repository. The parameter is not visible if theconnectioninput port is connected.

Connection entry

This parameter is only available when theconnection sourceparameter is set torepository. This parameter is used to specify a repository location that represents a connection entry. The connection can also be provided using theconnectioninput port.

Mongodb instance

This parameter is only available when theconnection sourceparameter is set topredefined. The MongoDB instance to be used to run the command can be specified here.

Command

The database command to be executed (a JSON/BSON document). Alternatively, you can specify this document via the command input port.