If you want to deal with non-current versions of the documents, you
probably should otherwise as soon as any user deletes a current
version they’re in the same old mess, then:
“SELECT r_object_id FROM dm_document (ALL) WHERE FOLDER
(‘<target_path> ‘,descend)”