replaceOne method

Future<WriteResult> replaceOne(
  1. dynamic selector,
  2. Map<String, dynamic> update, {
  3. bool? upsert,
  4. WriteConcern? writeConcern,
  5. CollationOptions? collation,
  6. String? hint,
  7. Map<String, Object>? hintDocument,
})

Implementation

Future<WriteResult> replaceOne(selector, Map<String, dynamic> update,
    {bool? upsert,
    WriteConcern? writeConcern,
    CollationOptions? collation,
    String? hint,
    Map<String, Object>? hintDocument}) async {
  var replaceOneOperation = ReplaceOneOperation(
      this,
      ReplaceOneStatement(_selectorBuilder2Map(selector), update,
          upsert: upsert,
          collation: collation,
          hint: hint,
          hintDocument: hintDocument),
      replaceOneOptions: ReplaceOneOptions(writeConcern: writeConcern));
  return replaceOneOperation.executeDocument();
}