summaryrefslogtreecommitdiff
path: root/jstests/core/query/ne/ne3.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/query/ne/ne3.js')
-rw-r--r--jstests/core/query/ne/ne3.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/core/query/ne/ne3.js b/jstests/core/query/ne/ne3.js
new file mode 100644
index 00000000000..5c38858c019
--- /dev/null
+++ b/jstests/core/query/ne/ne3.js
@@ -0,0 +1,22 @@
+// don't allow most operators with regex
+
+t = db.jstests_ne3;
+t.drop();
+
+assert.throws(function() {
+ t.findOne({t: {$ne: /a/}});
+});
+assert.throws(function() {
+ t.findOne({t: {$gt: /a/}});
+});
+assert.throws(function() {
+ t.findOne({t: {$gte: /a/}});
+});
+assert.throws(function() {
+ t.findOne({t: {$lt: /a/}});
+});
+assert.throws(function() {
+ t.findOne({t: {$lte: /a/}});
+});
+
+assert.eq(0, t.count({t: {$in: [/a/]}}));