replaceOne method

Future<Map<String, dynamic>> replaceOne(
  1. Map<String, dynamic> filter,
  2. Map<String, dynamic> update, {
  3. UpdateOptions? options,
  4. Transaction? transaction,
})

Implementation

Future<Map<String, dynamic>> replaceOne(
  Map<String, dynamic> filter,
  Map<String, dynamic> update, {
  UpdateOptions? options,
  Transaction? transaction,
}) async {
  final bson = BSON();
  final filterBytes = bson.serialize(filter);
  final updateBytes = bson.serialize(update);
  final ret = await p.replaceOne(
    collectionId,
    filterBytes,
    updateBytes,
    options: options,
    requestContext: transaction?.requestContext,
  );
  return ret;
}