ensureGeoIndex method

Future<Map<String, dynamic>> ensureGeoIndex(
  1. List<String> fields,
  2. {bool geoJson}
)

Implementation

Future<Map<String, dynamic>> ensureGeoIndex(
  List<String> fields, {
  bool geoJson,
}) async {
  final resp = await _connection.request(
    method: 'POST',
    path: '/_api/index',
    body: {
      'fields': fields,
      'type': 'geo',
      if (geoJson != null) 'geoJson': geoJson,
    },
    queries: {'collection': name},
  );
  return resp.body;
}