diff options
Diffstat (limited to 'jstests/ne3.js')
-rw-r--r-- | jstests/ne3.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/ne3.js b/jstests/ne3.js new file mode 100644 index 0000000..489f47a --- /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 |