FindAndModifyOperation class

Constructors

FindAndModifyOperation(DbCollection collection, {Map<String, dynamic>? query, Map<String, Object>? sort, bool? remove, Object? update, bool? returnNew, Map<String, dynamic>? fields, bool? upsert, List? arrayFilters, String? hint, Map<String, Object>? hintDocument, FindAndModifyOptions? findAndModifyOptions, Map<String, Object>? rawOptions})

Properties

arrayFilters List?
An array of filter documents that determine which array elements to modify for an update operation on an array field.
getter/setter pair
canRetryRead bool
no setterinherited
collection DbCollection?
getter/setter pairinherited
command Map<String, Object>?
getter/setter pairinherited
connection Connection?
getter/setter pairinherited
db Db
getter/setter pairinherited
fields Map<String, dynamic>?
A subset of fields to return. The fields document specifies an inclusion of a field with 1, as in: fields: {
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hint String?
Optional. Index specification. Specify either the index name as a string (hint field) or the index key pattern (hintDocument field). If specified, then the query system will only consider plans using the hinted index. starting in MongoDB 4.2, with the following exception, hint is required if the command includes the min and/or max fields; hint is not required with min and/or max if the filter is an equality condition on the _id field { _id:
getter/setter pair
hintDocument Map<String, Object>?
getter/setter pair
options Map<String, Object>
getter/setter pairinherited
query Map<String, dynamic>?
The selection criteria for the modification. The query field employs the same query selectors as used in the db.collection.find() method. Although the query may match multiple documents, findAndModify will only select one document to modify.
getter/setter pair
readPreference ReadPreference?
getter/setter pairinherited
remove bool
Must specify either the remove or the update field. Removes the document specified in the query field. Set this to true to remove the selected document . The default is false.
getter/setter pair
returnNew bool
When true, returns the modified document rather than the original. The findAndModify method ignores the 'new' option for remove operations. The default is false.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session Object?
getter/setter pairinherited
sort Map<String, Object>?
Determines which document the operation modifies if the query selects multiple documents. findAndModify modifies the first document in the sort order specified by this argument.
getter/setter pair
update Object?
Must specify either the remove or the update field. Performs an update of the selected document.
getter/setter pair
upsert bool
Used in conjunction with the update field.
getter/setter pair

Methods

$buildCommand() Map<String, Object>
clearSession() → void
inherited
execute({bool skipStateCheck = false}) Future<Map<String, dynamic>>
inherited
executeDocument() Future<FindAndModifyResult>
hasAspect(Aspect aspect) bool
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processOptions(Map<String, dynamic> command) → void
inherited
toString() String
A string representation of this object.
inherited

Operators

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