FindAndModifyOperation constructor
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,
Implementation
FindAndModifyOperation(DbCollection collection,
{this.query,
this.sort,
bool? remove,
this.update,
bool? returnNew,
this.fields,
bool? upsert,
this.arrayFilters,
this.hint,
this.hintDocument,
FindAndModifyOptions? findAndModifyOptions,
Map<String, Object>? rawOptions})
: remove = remove ?? false,
returnNew = returnNew ?? false,
upsert = upsert ?? false,
super(
collection.db,
<String, Object>{
...?findAndModifyOptions?.getOptions(collection.db),
...?rawOptions
},
collection: collection,
aspect: Aspect.writeOperation) {
if (arrayFilters != null && arrayFilters is! List && arrayFilters is! Map) {
throw MongoDartError(
'The arrayFilters parameter must be either a List or a Map');
}
}