Currently Collections are implemented with bidirectional references. A collection keeps a reference of its members in the collection:documentIds multi-valued field. A collection member keeps a reference on the collections it belongs to in collectionMember:collectionIds
It is obvious that a collection keeps a reference on its members. But why a collection member keeps the reference of the collections it belongs to.
In order to be able to efficiently query the member of a collection with ACLs filtering applying, we have currently no other choice than issuing such following query:
When we check-in a document (i.e. we make a version), its document parts are frozen and cannot be modified anymore. As a direct result, a version document cannot be added to a collection because we are not able to modify its collectionMember:collectionIds field. The same if we were to remove a Version from a Collection.
To overcome the limitation, we should get rid of the collectionMember:collectionIds and Collectable document should not keep any reference to the collections it belongs to. To achieve this, we need to make improvement on the NXQL language to be able to issue such query :
which will return a DocumentModel result set (i.e. the collection member) with ACLs filtering.
Which is not possible today.