Package dev.morphia.aggregation.stages
Class CurrentOp
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.CurrentOp
Returns a stream of documents containing information on active and/or dormant operations as well as inactive sessions that are
holding locks as part of a transaction.
-
Method Summary
Modifier and TypeMethodDescriptionallUsers
(boolean allUsers) If set to false, $currentOp will only report on operations/idle connections/idle cursors/idle sessions belonging to the user who ran the command.static CurrentOp
Creates a new stageidleConnections
(boolean idleConnections) If set to false, $currentOp will only report active operations.idleCursors
(boolean idleCursors) If set to true, $currentOp will report on cursors that are “idle”; i.e.idleSessions
(boolean idleSessions) Include idle sessions or notlocalOps
(boolean localOps) If set to true for an aggregation running on mongos, $currentOp reports only those operations running locally on that mongos.
-
Method Details
-
currentOp
Creates a new stage- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $currentOp
- Since server release
- 3.6
-
allUsers
- If set to false, $currentOp will only report on operations/idle connections/idle cursors/idle sessions belonging to the user who ran the command.
- If set to true, $currentOp will report operations belonging to all users.
- Parameters:
allUsers
- include allUsers if true- Returns:
- this
-
idleConnections
If set to false, $currentOp will only report active operations. If set to true, all operations including idle connections will be returned.- Parameters:
idleConnections
- include idle connections if true- Returns:
- this
-
idleCursors
If set to true, $currentOp will report on cursors that are “idle”; i.e. open but not currently active in a getMore operation.- Parameters:
idleCursors
- include idle cursors if true- Returns:
- this
-
idleSessions
Include idle sessions or not- Parameters:
idleSessions
- true to include idle sessions- Returns:
- this
-
localOps
If set to true for an aggregation running on mongos, $currentOp reports only those operations running locally on that mongos. If false, then the $currentOp will instead report operations running on the shards.- Parameters:
localOps
- true to include only local ops- Returns:
- this
-