diff options
Diffstat (limited to 'jstests/core/query/project/proj_key1.js')
-rw-r--r-- | jstests/core/query/project/proj_key1.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/core/query/project/proj_key1.js b/jstests/core/query/project/proj_key1.js new file mode 100644 index 00000000000..c4834ffad49 --- /dev/null +++ b/jstests/core/query/project/proj_key1.js @@ -0,0 +1,18 @@ +// @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.createIndex({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()); |