summaryrefslogtreecommitdiff
path: root/jstests/core/query/js/js5.js
blob: f41a4de78d4aafc38126846ac3056e32f7230f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// @tags: [
//     # Uses $where operator
//     requires_scripting
// ]

let t = db.jstests_js5;
t.drop();

t.save({a: 1});
t.save({a: 2});

assert.eq(2, t.find({"$where": "this.a"}).count(), "A");
assert.eq(0, t.find({"$where": "this.b"}).count(), "B");
assert.eq(0, t.find({"$where": "this.b > 45"}).count(), "C");