summaryrefslogtreecommitdiff
path: root/jstests/core/index/geo/geo_invalid_2d_params.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/index/geo/geo_invalid_2d_params.js')
-rw-r--r--jstests/core/index/geo/geo_invalid_2d_params.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/core/index/geo/geo_invalid_2d_params.js b/jstests/core/index/geo/geo_invalid_2d_params.js
new file mode 100644
index 00000000000..33419302b47
--- /dev/null
+++ b/jstests/core/index/geo/geo_invalid_2d_params.js
@@ -0,0 +1,8 @@
+var t = db.geo_invalid_2d_params;
+t.drop();
+
+assert.commandFailed(t.createIndex({loc: "2d"}, {bits: 33}));
+assert.commandFailed(t.createIndex({loc: "2d"}, {min: -1, max: -1}));
+assert.commandFailed(t.createIndex({loc: "2d"}, {bits: -1}));
+assert.commandFailed(t.createIndex({loc: "2d"}, {min: 10, max: 9}));
+assert.commandWorked(t.createIndex({loc: "2d"}, {bits: 1, min: -1, max: 1}));