mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
15 lines
314 B
JavaScript
15 lines
314 B
JavaScript
// @tags: [
|
|
// # Uses $where operator
|
|
// requires_scripting
|
|
// ]
|
|
|
|
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");
|