stefan-egli commented on code in PR #1451:
URL: https://github.com/apache/jackrabbit-oak/pull/1451#discussion_r1598743492


##########
oak-run/src/main/js/oak-mongo.js:
##########
@@ -329,6 +329,53 @@ var oak = (function(global){
         return {nRemoved : count};
     };
 
+    /**
+     * Finds all the descendants with a _modified timestamp older than the
+     * given timestamp.
+     *
+     * @memberof oak
+     * @method findDescendantsOlderThan
+     * @param {string} path of the parent node to search.
+     * @param {number} timestamp to compare with.
+     */
+    api.findDescendantsOlderThan = function(path, timestamp) {
+        var count = 0;
+        var depth = pathDepth(path);
+        var prefix = path + "/";
+        depth++;
+        var query = { _id: pathFilter(depth, prefix), _modified: {$lt: 
timestamp}};
+        db.nodes.find(query).forEach(function(doc) {
+            print(doc._id);
+            count++;
+        });
+        print("nCandidates : " + count);
+    }
+
+    /**
+     * Removes all the descendants with a _modified timestamp older than the
+     * given timestamp.
+     * Use removeDescendantsAndSelf() first to get the list of nodes to remove.

Review Comment:
   ```suggestion
        * Use findDescendantsOlderThan() first to get the list of nodes to 
remove.
   ```
   
   Was this indeed meant to refer to removeDescendantsAndSelf, or not 
findDescendantsOlderThan?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to