allDocuments method

Future<Map<String, dynamic>?> allDocuments(
  1. String col, {
  2. String? type,
})

Returns all documents of a collection

Implementation

Future<Map<String, dynamic>?> allDocuments(String col, {String? type}) async {
  Map<String, dynamic>? res;
  try {
    var request = collection.client
        .prepareRequest('/_api/simple/all-keys', methode: 'put');
    request.body = type == null
        ? '{"collection": $col}'
        : '{"collection": $col, "type": $type}';
    res = await collection.client.exec(request);
  } catch (e) {
    print(e);
  }
  return res;
}