WriteResult class

A wrapper that contains the result status of the mongo shell write methods:

  • insert
  • update
  • remove
  • save

Constructors

WriteResult.fromMap(WriteCommandType writeCommandType, Map<String, dynamic> result)

Properties

code int?
getter/setter pairinherited
codeName String?
getter/setter pairinherited
document Map<String, dynamic>?
getter/setter pair
errmsg String?
Optional error fields
getter/setter pairinherited
failure bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasWriteConcernError bool
no setterinherited
hasWriteErrors bool
no setter
id ↔ dynamic
getter/setter pair
isAcknowledged bool
no setterinherited
isFailure bool
no setterinherited
isPartial bool
The operation has been partially executed, but we don't know anything about acknowledgment
no setterinherited
isPartialSuccess bool
The operation has been partially executed and it has been acknowledged Please note that if the write concern was not majority the operation could be rollbacked yet in case of primary failure
no setterinherited
isSuccess bool
The operation has been completeded successfully and it has been acknowledged Please note that if the write concern was not majority the operation could be rollbacked yet in case of primary failure
no setterinherited
isSuspendedPartial bool
The operation has been partially executed and it has not been acknowledged
no setterinherited
isSuspendedSuccess bool
The operation has been completeded successfully but it has not been acknowledged
no setterinherited
nInserted int
The number of documents inserted, excluding upserted documents. See nUpserted for the number of documents inserted through an upsert.
getter/setter pairinherited
nMatched int
The number of documents selected for update. If the update operation results in no change to the document, e.g. $set expression updates the value to the current value, nMatched can be greater than nModified.
getter/setter pairinherited
nModified int
The number of existing documents updated. If the update/replacement operation results in no change to the document, such as setting the value of the field to its current value, nModified can be less than nMatched.
getter/setter pairinherited
nRemoved int
The number of documents removed.
getter/setter pairinherited
nUpserted int
The number of documents inserted by an upsert.
getter/setter pairinherited
ok double
Command status (1.0 Ok, 0.0 error)
getter/setter pairinherited
operationSucceeded bool
This simply checks the OK value, that could return error (0.0) if network problems are detected.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverResponses List<Map<String, dynamic>>
This is the original response from the server;
getter/setter pairinherited
success bool
no setterinherited
taskCompleted bool
The operation has been executed, but we don't know anything about acknowledgment
no setterinherited
totalInserted int
no setterinherited
writeCommandType ↔ WriteCommandType?
The command that generated this output;
getter/setter pairinherited
writeConcernError ↔ WriteConcernError?
getter/setter pairinherited
writeError ↔ WriteError?
getter/setter pair
writeErrorsNumber int
no setter

Methods

checkQueryExpectation(int expectedMatches) bool
inherited
extractBasic(Map<String, dynamic> document) → void
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