batchUpdate method

Future<BatchUpdateResult> batchUpdate(
  1. String collection,
  2. List<BatchUpdateOperation> operations
)

Performs batch update

Implementation

Future<BatchUpdateResult> batchUpdate(
  String collection,
  List<BatchUpdateOperation> operations,
) async {
  final response = await _client.post(
    Uri.parse('$baseUrl/database/collections/$collection/batch-update'),
    headers: _headers,
    body: jsonEncode({
      'operations': operations.map((o) => o.toJson()).toList(),
    }),
  );

  final data = _handleResponse(response);
  return BatchUpdateResult.fromJson(data);
}