mongodb/mongo-php-driver — pull request #314 by derickr (2013-02-15 17:03:05+00:00)
Title: Fixed PHP-378: Allow limit() to be re-run under specific conditions after iteration has started.

We allow limit() to be re-run when either the cursor has not started to iterate
yet as normal. We now also allow limit() with a positive value to be called as
long as the cursor has not been exhausted (either through running to the end,
or an initial negative limit() or batchSize().

The second call (and futher calls) to limit() *add* to the already set limit
with as usecase being that in some cases you can not do all the filtering in
the query and hence need to ask for more data in case your client side filtered
data has not reached your expected limit. Another use case might be that one of
the documents that you've received indicates that there is more interesting
stuff coming later too, so that you can adjust the limit.