batchMixed method

Future<BatchMixedResult> batchMixed(
  1. String collection,
  2. List<BatchOperation> operations
)

Performs batch mixed operations

Implementation

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

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