summaryrefslogtreecommitdiff
path: root/jstests/core/geo_2d_with_geojson_point.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/geo_2d_with_geojson_point.js')
-rw-r--r--jstests/core/geo_2d_with_geojson_point.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/core/geo_2d_with_geojson_point.js b/jstests/core/geo_2d_with_geojson_point.js
new file mode 100644
index 00000000000..b5afc8b77b8
--- /dev/null
+++ b/jstests/core/geo_2d_with_geojson_point.js
@@ -0,0 +1,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.'));