I am trying to access ContentVersion, ContentDocument, ContentDocumentLink to achieve a count of each contentversion per object. The relationships between the objects
I activated QueryAll Document, and this gets me the count per ContendDocument for each objects :
SELECT COUNT(Id) counter, LinkedEntity.type
FROM ContentDocumentLink
GROUP BY LinkedEntity.type
But now given that I want to know the count of Id for each ContentVersion I am lost on how to query, given that a subquery should be like this for example :
SELECT Id, Title,
(SELECT Id FROM ContentVersions),
(SELECT Id, LinkedEntity.Type FROM ContentDocumentLinks)
FROM ContentDocument
which get me all the information, I have the contentVersions and the Object linked to it, but I cannot group to have a count.
Could a SOQL master help me here?
Thanks