-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 2.1.4
-
Component/s: MongoDB 3.2
-
None
-
None
-
None
-
None
-
None
-
None
-
None
reading data in raw mode that is an exact multiple of the batch size items errors out.
If the data size < batch size or data size % batch size != 0, it works.
If raw: false is specified, it works.
tested with mongodb V2.1.3 and V2.1.4, node v0.10.41
mongoClient.connect(url, dbOpts, function(err, db) {
var data = []
for (var i=0; i<20; i++) data.push({a:i});
db = db.db('test');
db.collection("rawtest").remove({}, function(err) {
db.collection("rawtest").insert(data, {w: 1}, function(err) {
db.collection("rawtest").find({}, {raw: true}, function(err, cursor2) {
cursor2.batchSize(10);
cursor2.toArray(function(err, items2) {
console.log("err:", err)
//console.log(items2);
//console.log("item count:", items2.length)
db.close();
})
});
});
});
});
% node mongo-test.js
err: { [MongoError: invalid getMore result returned for cursor id 57051939534]
name: 'MongoError',
message: 'invalid getMore result returned for cursor id 57051939534' }