ensureSkipListIndex method

Future<Map<String, dynamic>> ensureSkipListIndex(
  1. List<String> fields,
  2. {bool unique = false,
  3. bool sparse = false,
  4. bool deduplicate = true}
)

Implementation

Future<Map<String, dynamic>> ensureSkipListIndex(
  List<String> fields, {
  bool unique = false,
  bool sparse = false,
  bool deduplicate = true,
}) async {
  final resp = await _connection.request(
    method: 'POST',
    path: '/_api/index',
    body: {
      'type': 'skiplist',
      'unique': unique,
      'sparse': sparse,
      'deduplicate': deduplicate,
      'fields': fields,
    },
    queries: {'collection': name},
  );
  return resp.body;
}