spring-projects/spring-data-mongodb — pull request #191 by christophstrobl (2014-06-18 09:01:04+00:00)
Title: DATAMOMNGO-950 - Add support for limiting the query result in the query derivation mechanism.

When deriving the query from its method name we check for the `limit` set on the `PartTree` to pass this on to the created query. Therefore we added an additional attribute `maxResults` to `Query` that is used by `QueryCursorPreparer` to set the limit accordingly to the max results. As we needed to return a `Cursor` not holding any results for queries where `skip` exceeds `maxResults` we changed the `QueryPreparer` interface to use `Cursor` instead of `DBCursor`.

Please note that `query.maxResults` does not add `$maxScan` to the query but alters `cursor.limit`.