Skip to main content

tcb db nosql execute

Run database native commands through the RunCommands API.

Usage​

tcb db nosql execute --command '<json>' [options]

Parameters​

ParameterRequiredDescriptionDefault
-c, --command <json>YesMgoCommands JSON—
--tag <tag>NoInstance tag, used to tell instances apart when an environment has several—
--instanceId <id>NoMongoConnector instance ID—
--databaseName <name>NoMongoConnector database name—
-e, --env-id <envId>YesEnvironment ID—

API reference: RunCommands · MgoCommandParam

Examples​

# Query the first 5 documents in the users collection
tcb db nosql execute \
--command '{"find": "users", "limit": 5}' \
-e my-env-id

# Run against a specific instance
tcb db nosql execute \
--command '{"count": "orders", "query": {"status": "paid"}}' \
--instanceId inst-xxx \
-e my-env-id