list method

Future<List<String>> list(
  1. [String type = 'id']
)

Implementation

Future<List<String>> list([String type = 'id']) async {
  if (_connection.arangoMajor <= 2) {
    final resp = await _connection.request(
      path: '/_api/document',
      queries: {'type': type, 'collection': name},
    );
    return List<String>.from(resp.body['documents']);
  }

  final resp = await _connection.request(
    method: 'PUT',
    path: '/_api/simple/all-keys',
    body: {'type': type, 'collection': name},
  );

  return List<String>.from(resp.body['result']);
}