summaryrefslogtreecommitdiff
path: root/jstests/core/geo_2d_with_geojson_point.js
blob: b5afc8b77b8a8d6618dd079e027aa5c41b0f36a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * 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.'));