insert method

Future<Map<String, dynamic>> insert(
  1. String collection,
  2. Map<String, dynamic> document
)

Inserts a document

Implementation

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

  return _handleResponse(response);
}