patch method

Future<DbResponse> patch(
  1. Map<String, dynamic> updateChildren, {
  2. String? path,
  3. PrintMode? printMode,
})

Sends a patch requests to the database to update some data.

Tries to update the given fields of updateChildren to their new values at path, or to the virtual root, if not set. Only fields explicitly specified are updated, all other fields are not modified. To delete a field, set the update value to null.

The printMode can be used to control how data is formatted by the server.

Implementation

Future<DbResponse> patch(
  Map<String, dynamic> updateChildren, {
  String? path,
  PrintMode? printMode,
}) async {
  final response = await client.patch(
    _buildUri(
      path: path,
      printMode: printMode,
    ),
    body: json.encode(updateChildren),
    headers: _buildHeaders(
      hasBody: true,
    ),
  );
  return _parseResponse(response, false);
}