Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
2.6.0-rc0
-
Query
-
ALL
Description
Cursor object can't contain other fields than batchSize.
Altough specifying multiple fields one of which is batchSize is legit, and this doesn't honour the aforementioned property.
> use foo
|
switched to db foo
|
> var bigArray = [];
|
> for (var i = 0; i < 1000; ++i) { bigArray.push(i); }
|
1000
|
> var bigStr = Array(1001).toString();
|
> for (var i = 0; i < 100; ++i) { db.goo.insert({_id: i, bigArray: bigArray, bigStr: bigStr})};
|
WriteResult({ "nInserted" : 1 })
|
> var cursor = db.runCommand({aggregate: "goo", pipeline: [{$unwind:'$bigArray'}], cursor : {baf: 1}})
|
> cursor
|
{
|
"errmsg" : "exception: cursor object can't contain fields other than batchSize",
|
"code" : 16955,
|
"ok" : 0
|
}
|
> var cursor = db.runCommand({aggregate: "goo", pipeline: [{$unwind:'$bigArray'}], cursor : {batchSize: 1, a: 234}})
|
>
|
> cursor
|
{
|
"cursor" : {
|
"id" : NumberLong("220445851281"),
|
"ns" : "foo.goo",
|
"firstBatch" : [
|
{
|
"_id" : 0,
|
"bigArray" : 0,
|
"bigStr" : ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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