Details
Description
The implementation of the find command on mongos currently ignores the "singleBatch" option. Instead, the find command needs to delete the cursor associated with the user query if "singleBatch" is set.
To reproduce:
mongos> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
mongos> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
mongos> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
mongos> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
mongos> db.foo.runCommand({find:"foo", batchSize: 2, singleBatch: true}) |
{
|
"cursor" : { |
"id" : NumberLong("3770113749959775933"), // Unexpected: this value should be zero. |
"ns" : "test.foo", |
"firstBatch" : [ |
{
|
"_id" : ObjectId("55fb050f8be93f1540cba838") |
},
|
{
|
"_id" : ObjectId("55fb050f8be93f1540cba839") |
}
|
]
|
},
|
"ok" : 1 |
}
|