Package dev.morphia.aggregation.stages
Class CurrentOp
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.stages.CurrentOp
-
public class CurrentOp extends Stage
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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCurrentOp()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CurrentOpallUsers(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 CurrentOpcurrentOp()Creates a new stageCurrentOpidleConnections(boolean idleConnections)If set to false, $currentOp will only report active operations.CurrentOpidleCursors(boolean idleCursors)If set to true, $currentOp will report on cursors that are “idle”; i.e. open but not currently active in a getMore operation.CurrentOpidleSessions(boolean idleSessions)Include idle sessions or notbooleanisAllUsers()booleanisIdleConnections()booleanisIdleCursors()booleanisIdleSessions()booleanisLocalOps()CurrentOplocalOps(boolean localOps)If set to true for an aggregation running on mongos, $currentOp reports only those operations running locally on that mongos.static CurrentOpof()Deprecated, for removal: This API element is subject to removal in a future version.usercurrentOp()-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
currentOp
public static CurrentOp currentOp()
Creates a new stage- Returns:
- the new stage
- Since:
- 2.2
-
of
@Deprecated(forRemoval=true) public static CurrentOp of()
Deprecated, for removal: This API element is subject to removal in a future version.usercurrentOp()Creates a new stage- Returns:
- the new stage
-
allUsers
public CurrentOp allUsers(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.
- If set to true, $currentOp will report operations belonging to all users.
- Parameters:
allUsers- include allUsers if true- Returns:
- this
-
idleConnections
public CurrentOp idleConnections(boolean 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
public CurrentOp idleCursors(boolean 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
public CurrentOp idleSessions(boolean idleSessions)
Include idle sessions or not- Parameters:
idleSessions- true to include idle sessions- Returns:
- this
-
isAllUsers
@MorphiaInternal public boolean isAllUsers()
- Returns:
- include all users?
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
isIdleConnections
@MorphiaInternal public boolean isIdleConnections()
- Returns:
- include idle connections?
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
isIdleCursors
@MorphiaInternal public boolean isIdleCursors()
- Returns:
- include idle cursors?
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
isIdleSessions
@MorphiaInternal public boolean isIdleSessions()
- Returns:
- include idle sessions?
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
isLocalOps
@MorphiaInternal public boolean isLocalOps()
- Returns:
- is local ops?
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
localOps
public CurrentOp localOps(boolean 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
-
-