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.
  • Method Details

    • currentOp

      public static CurrentOp currentOp()
      Creates a new stage
      Returns:
      the new stage
      Since:
      2.2
      MongoDB documentation
      Aggregration Pipeline Stage: $currentOp
      Since server release
      3.6
    • allUsers

      public CurrentOp allUsers(boolean allUsers)
      1. If set to false, $currentOp will only report on operations/idle connections/idle cursors/idle sessions belonging to the user who ran the command.
      2. 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
    • 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