Permalink
Browse files

tests that already pass for $or with $where and geo

  • Loading branch information...
1 parent aa547ad commit 7e0a43212e83989d825b8cb68bb8fb1859acda80 Mike Dirolf committed Jul 20, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 jstests/ora.js
View
@@ -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'];});

0 comments on commit 7e0a432

Please sign in to comment.