Description
This code currently has a hardwired optimization for MongoDB (allowing a range query on the lastmod property). For any other persistence, all nodes will be traversed.
The DocumentStore query API allows to specify a single indexedProperty with a start value. We should use this, and find out whether that's sufficiently better.
If it's not, we may want to extend the DocumentStore API, so that DS implementations other than Mongo can come up with better implementations of the query.