summaryrefslogtreecommitdiff
path: root/jstests/core/geo_2d_with_geojson_point.js
blob: 3930f3c2c961b117ac29fcecfefc5c28ca092470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * Use of GeoJSON points should be prohibited with a 2d index, SERVER-10636.
 */

var t = db.geo_2d_with_geojson_point;
t.drop();
t.createIndex({loc: '2d'});

var geoJSONPoint = {type: 'Point', coordinates: [0, 0]};

print(assert.throws(function() {
          t.findOne({loc: {$near: {$geometry: geoJSONPoint}}});
      }, [], 'querying 2d index with GeoJSON point.'));