From my reading of the docs, the test should pass -- am I right?
If I am, I can send a pull request with the new test. I'd much rather send a pull request with a fix as well, but I haven't been able to figure out what's going wrong from looking through the driver source.
> From my reading of the docs, the test should pass -- am I right?
Maybe, it might have to do with the $cursor->reset() or something. Could you please file a bugreport at https://jira.mongodb.org/browse/PHP so that we can track this? We'll take it from there then. It would be best if it contained a self-contained script (just a .php) file instead of a patch to a phpunit test.
> From my reading of the docs, the test should pass -- am I right?
> If I am, I can send a pull request with the new test. I'd much rather send > a pull request with a fix as well, but I haven't been able to figure out > what's going wrong from looking through the driver source.
I am seeing a similar issue. The only difference between my code and what Matt has written is the order in which I set the batchSize and sort on the cursor.
I do something like: $cursor = $mongo->{$table_name}->find($mongo_args)->sort(array('ts' => 1)); $cursor->batchSize(5000);
Would this cause any discrepancies. Derick, I read your article on how Mongo cursors work in PHP ... really great stuff. It is this article that inspired me to use the batchSize because the logs I am pulling from mongo are enormous. Any idea on when this issue might be resolved?
> > From my reading of the docs, the test should pass -- am I right?
> Maybe, it might have to do with the $cursor->reset() or something. Could > you please file a bugreport at https://jira.mongodb.org/browse/PHP so > that we can track this? We'll take it from there then. It would be best > if it contained a self-contained script (just a .php) file instead of a > patch to a phpunit test.
On Tue, 25 Sep 2012, Alex Montgomery wrote:
> Hello all,
> I am seeing a similar issue. The only difference between my code and what > Matt has written is the order in which I set the batchSize and sort on the > cursor.
> I do something like: > $cursor = $mongo->{$table_name}->find($mongo_args)->sort(array('ts' => 1));
> $cursor->batchSize(5000);
Order doesn't matter, as the query only gets send to the server when you start iterating with foreach().
> Would this cause any discrepancies. Derick, I read your article on > how Mongo cursors work in PHP ... really great stuff. It is this > article that inspired me to use the batchSize because the logs I am > pulling from mongo are enormous. Any idea on when this issue might be > resolved?
The thread initiator didn't give us an issue - if you can create one with a full dataset and example for us to try to reproduce it, we'd be happy to look at it.