summaryrefslogtreecommitdiff
path: root/jstests/core/eval4.js
blob: 0d120b393de43082a6d565b4c227cb173b26394d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

t = db.eval4;
t.drop();

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

assert.eq(3, t.count(), "A");

function f(x) {
    db.eval4.remove({a: x});
}

f(2);
assert.eq(2, t.count(), "B");

db.eval(f, 2);
assert.eq(2, t.count(), "C");

db.eval(f, 3);
assert.eq(1, t.count(), "D");