updateOne method

Future<Object?> updateOne({
  1. required Object collectionName,
  2. required Object id,
  3. Map<String, Object?>? query,
  4. Object? body,
  5. Object? arrayFilters,
  6. Map<String, String>? headers,
})

PUT /{version}/database/collections/{collectionName}/{id}

arrayFilters — MongoDB arrayFilters for $[name] paths in the update ({"lines.$[line].qty": 3} with [{'line.sku': 'A-1'}]): a list of filter documents, encoded to the JSON string the gateway reads, or that string itself. Added to the map body as arrayFilters.

Implementation

Future<Object?> updateOne(
    {required Object collectionName,
    required Object id,
    Map<String, Object?>? query,
    Object? body,
    Object? arrayFilters,
    Map<String, String>? headers}) {
  return transport.send(
    route: '/{version}/database/collections/{collectionName}/{id}',
    method: 'PUT',
    query: query,
    body: withArrayFilters(body, arrayFilters),
    headers: headers,
    pathParams: <String, Object?>{'collectionName': collectionName, 'id': id},
  );
}