Domain name for API request: mongodb.intl.tencentcloudapi.com.
This API is used to query the operation currently being performed on a TencentDB for MongoDB instance.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DescribeCurrentOp. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-25. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Specifies the instance ID to be queried. Log in to the TencentDB for MongoDB console, and copy the instance ID from the instance list. |
| Ns | No | String | Namespace where the operation belongs, in the format of db.collection. |
| MillisecondRunning | No | Integer | Sets the query and filtering condition to the execution time of the operation task. - The default value is 0, and the value range is [0, 3600000], in milliseconds. - The result will return the operation whose execution time exceeds the set time. |
| Op | No | String | Sets the query and filtering condition to the type of the operation task. Valid values: - none: special status; idle connections or internal tasks. - update: update data. - insert: insertion operation. - query: query operation. - command: command operation. - getmore: obtain more data. - remove: deletion operation. - killcursors: operation of releasing the query cursor. |
| ReplicaSetName | No | String | Filtering condition, such as the shard name. |
| State | No | String | Sets the query and filtering condition to the node role. - primary: primary node. - secondary: secondary node. |
| Limit | No | Integer | Number of entries returned per request. The default value is 100, and the value range is [0, 100]. |
| Offset | No | Integer | Offset. The default value is 0, and the value range is [0, 10000]. |
| OrderBy | No | String | Sorting field of the returned result set. Currently, sorting by MicrosecsRunning (execution time of the operation task) is supported. |
| OrderByType | No | String | Sorting method of the returned result set. - ASC: ascending order. The default value is ASC, which indicates sorting in ascending order. - DESC: descending order. |
| Parameter Name | Type | Description |
|---|---|---|
| TotalCount | Integer | Total number of operations meeting the query conditions. |
| CurrentOps | Array of CurrentOp | List of the current operations. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to query the current operation on the TencentDB for MongoDB instance.
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCurrentOp
<Common request parameters>
{
"InstanceId": "cmgo-r3p8****",
"State": "primary"
}{
"Response": {
"CurrentOps": [
{
"ExecNode": "Primary node",
"MicrosecsRunning": 103,
"NodeName": "**.**.**.**:****:*********",
"Ns": "admin.$cmd.aggregate",
"Op": "command",
"OpId": 42431451,
"Operation": "{\"Active\":true,\"AppName\":\"CMongo\",\"Client\":\"**.**.**.**:**\",\"ClientMetadata\":{\"application\":{\"name\":\"CMongo\"},\"driver\":{\"name\":\"mongo-go-driver\",\"version\":\"v1.*.*\"},\"os\":{\"architecture\":\"amd64\",\"type\":\"linux\"},\"platform\":\"***.**.*\"},\"Command\":{\"$db\":\"admin\",\"$readPreference\":{\"mode\":\"primaryPreferred\"},\"currentOp\":1,\"lsid\":{\"id\":{\"Data\":\"************************==\",\"Subtype\":4}},\"microsecs_running\":{\"$gt\":0}},\"ConnectionId\":********,\"CurrentOpTime\":\"2025-09-25T17:41:42.146+0800\",\"Desc\":\"conn*******\",\"Host\":\"*******64.site:7029\",\"Insert\":null,\"KillPending\":false,\"LockStats\":{},\"Locks\":{},\"Lsid\":{\"id\":{\"Data\":\"*******************==\",\"Subtype\":4},\"uid\":{\"Data\":\"********************************=\",\"Subtype\":0}},\"MicroSecsRunning\":103,\"Msg\":\"\",\"Ns\":\"admin.$cmd.aggregate\",\"NumYields\":0,\"Op\":\"command\",\"OpId\":********,\"OriginatingCommand\":null,\"PlanSummary\":\"\",\"Progress\":null,\"Query\":null,\"SecsRunning\":0,\"Transaction\":null,\"WaitingForLock\":false}",
"Query": "{\"$db\":\"admin\",\"$readPreference\":{\"mode\":\"primaryPreferred\"},\"currentOp\":1,\"lsid\":{\"id\":{\"Data\":\"***********************==\",\"Subtype\":4}},\"microsecs_running\":{\"$gt\":0}}",
"ReplicaSetName": "cmgo-r3p8****_0",
"State": "primary"
}
],
"RequestId": "a1f20aaa-83c2-4062-b4f3-7c46ad2e1157",
"TotalCount": 1
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InvalidParameter.PermissionDenied | The current sub-account has no permission to perform this operation. |
| InvalidParameterValue.NotFoundInstance | The instance was not found. |
| InvalidParameterValue.QueryOutOfRange | The query offset is out of range. |
| InvalidParameterValue.RegionNotSupportOperation | The current region does not support this operation. |
| InvalidParameterValue.ReplicaNotFound | The replica set/shard is not found. |
Feedback