summaryrefslogtreecommitdiff
path: root/jstests/ne3.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-08-30 20:11:00 -0700
committerAaron <aaron@10gen.com>2010-08-30 20:11:00 -0700
commit30c59fa55079088d1d60a318e5e3f526f600856e (patch)
tree2f29e56b0c38ea4db6302ae15617178ded821c3f /jstests/ne3.js
parentfccae83a3ca86869bbd767facc061779d7180cc0 (diff)
downloadmongo-30c59fa55079088d1d60a318e5e3f526f600856e.tar.gz
SERVER-1705 validate op type with regex
Diffstat (limited to 'jstests/ne3.js')
-rw-r--r--jstests/ne3.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/ne3.js b/jstests/ne3.js
new file mode 100644
index 00000000000..489f47aec0d
--- /dev/null
+++ b/jstests/ne3.js
@@ -0,0 +1,12 @@
+// 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/ ] } } ) ); \ No newline at end of file