Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (revision 1800269) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (working copy) @@ -612,6 +612,9 @@ } try { DBCursor cursor = dbCollection.find(query).sort(BY_ID_ASC); + if (limit >= 0) { + cursor.limit(limit); + } if (!disableIndexHint && !hasModifiedIdCompoundIndex) { cursor.hint(hint); }