summaryrefslogtreecommitdiff
path: root/jstests/core/geo_2d_with_geojson_point.js
blob: 23592e004f870b8b586d7c9b9ba760fb109f08fd (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.ensureIndex({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.'));