$currentOp class

$currentOp aggregation stage

Stage description.

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. The stage returns a document for each operation or session. To run $currentOp, use the db.aggregate() helper on the admin database.

The $currentOp aggregation stage is preferred over the currentOp command. Because the currentOp command and db.currentOp() helper method return the results in a single document, the total size of the currentOp result set is subject to the maximum 16MB BSON size limit for documents. The $currentOp stage returns a cursor over a stream of documents, each of which reports a single operation. Each operation document is subject to the 16MB BSON limit, but unlike the currentOp command, there is no limit on the overall size of the result set.

$currentOp also enables you to perform arbitrary transformations of the results as the documents pass through the pipeline.

Example:

Dart code

$currentOp(allUsers: true, idleSessions: true).build()

Equivalent mongoDB aggregation stage:

{
 { $currentOp : { allUsers: true, idleSessions: true } }
}

https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentOp/

Inheritance

Constructors

$currentOp({bool? allUsers, bool? idleConnections, bool? idleCursors, bool? idleSessions, bool? localOps, bool? backtrace})
Creates $changeStream aggregation stage
$currentOp.raw(MongoDocument raw)

Properties

content ExpressionContent
no setterinherited
entry MapEntry<String, ExpressionContent>
getter/setter pairinherited
fieldName String
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
key String
no setterinherited
rawContent → dynamic
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stageName String
no setterinherited

Methods

build() MongoDocument
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited