batchInsert method

Future<BatchInsertResult> batchInsert(
  1. String collection,
  2. List<Map<String, dynamic>> documents
)

Performs batch insert

Implementation

Future<BatchInsertResult> batchInsert(
  String collection,
  List<Map<String, dynamic>> documents,
) async {
  final response = await _client.post(
    Uri.parse('$baseUrl/database/collections/$collection/batch-insert'),
    headers: _headers,
    body: jsonEncode({'documents': documents}),
  );

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