mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
17 lines
341 B
JavaScript
17 lines
341 B
JavaScript
// @tags: [requires_getmore]
|
|
|
|
t = db.proj_key1;
|
|
t.drop();
|
|
|
|
as = [];
|
|
|
|
for (i = 0; i < 10; i++) {
|
|
as.push({a: i});
|
|
t.insert({a: i, b: i});
|
|
}
|
|
|
|
t.ensureIndex({a: 1});
|
|
|
|
assert.eq(as, t.find({a: {$gte: 0}}, {a: 1, _id: 0}).sort({a: 1}).toArray());
|
|
assert.eq(as, t.find({a: {$gte: 0}}, {a: 1, _id: 0}).sort({a: 1}).batchSize(2).toArray());
|