diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2014-02-19 12:45:53 -0500 |
---|---|---|
committer | Matt Kangas <matt.kangas@mongodb.com> | 2014-03-03 22:54:10 -0500 |
commit | 3660343e0b4627d2fee4afb89b74d32644d16d18 (patch) | |
tree | ffa571e0b73ce56d73c2ae23f458f0db772ef782 /jstests/core/ora.js | |
parent | 9fae141a1f3fe652fa6002e47722c5ceb051cffb (diff) | |
download | mongo-3660343e0b4627d2fee4afb89b74d32644d16d18.tar.gz |
SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js
Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'jstests/core/ora.js')
-rw-r--r-- | jstests/core/ora.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/core/ora.js b/jstests/core/ora.js new file mode 100644 index 00000000000..67af4c191ec --- /dev/null +++ b/jstests/core/ora.js @@ -0,0 +1,17 @@ +var t = db.jstests_ora; + +// $where +t.drop(); +for (var i = 0; i < 10; i += 1) { + t.save({x: i, y: 10 - i}); +} +assert.eq.automsg("1", "t.find({$or: [{$where: 'this.x === 2'}]}).count()"); +assert.eq.automsg("2", "t.find({$or: [{$where: 'this.x === 2'}, {$where: 'this.y === 2'}]}).count()"); +assert.eq.automsg("1", "t.find({$or: [{$where: 'this.x === 2'}, {$where: 'this.y === 8'}]}).count()"); +assert.eq.automsg("10", "t.find({$or: [{$where: 'this.x === 2'}, {x: {$ne: 2}}]}).count()"); + +// geo +t.drop(); +t.ensureIndex({loc: "2d"}); + +assert.throws(function () {t.find({$or: [{loc: {$near: [11, 11]}}]}).limit(1).next()['_id'];}); |