rishabhdaim opened a new pull request, #3032:
URL: https://github.com/apache/jackrabbit-oak/pull/3032

   ## Summary
   
   `removeDescendantsAndSelfWithLeavesFirst()` in `oak-run`'s `oak-mongo.js` 
always removed the root node along with its descendants. This adds an optional 
second `removeRoot` parameter (default `false`) so callers can choose to keep 
the root node and only remove its descendants.
   
   ## Changes
   
   - `oak.removeDescendantsAndSelfWithLeavesFirst(path, removeRoot)`: new 
`removeRoot` param, defaults to `false` (preserves the root unless explicitly 
requested).
   - Throws an `Error` when `path` is `"/"`.
   - Root existence check now also considers long-path documents.
   
   ## Test Plan
   
   - [ ] Manual verification against a Mongo instance: deleting a subtree with 
`removeRoot=false` keeps the root node; `removeRoot=true` removes it (matches 
old behavior).
   
   ## Links
   
   - JIRA: https://issues.apache.org/jira/browse/OAK-12315
   
   Co-Authored-By: Claude Sonnet 5 <[email protected]>


-- 
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