Class 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 Detail

      • CurrentOp

        protected CurrentOp()
    • 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.
        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

    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

    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

    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

    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

    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