summaryrefslogtreecommitdiff
path: root/jstests/core/eval4.js
blob: b67aa4b44451fa021eb6cf59cbd100a247394e75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Cannot implicitly shard accessed collections because unsupported use of sharded collection
// from db.eval.
// @tags: [assumes_unsharded_collection]

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");