select with latest modification date

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

select with latest modification date

Hello All

I have a similar document type stored in couple of folders. I would like select the most recent one using CMIS queries.

Is there a way to accomplish that?

Thanks

Krzysztof

4 Replies
Highlighted
Master

Re: select with latest modification date

Just sort your query based on cmis:lastModificationDate in descending order and select the first...

i.e.: SELECT * from cmis:document D WHERE (IN_FOLDER(D, 'folderId1') OR IN_FOLDER(D, 'folderId2') ....) ORDER BY D.cmis:lastModificationDate DESC

Highlighted
Member II

Re: select with latest modification date

Cool, thanks.

Any way to limit the results collection to one record?

Highlighted
Senior Member

Re: select with latest modification date

Hi

You should be able to use paging and limits on the request. The CMIS browser binding uses the maxItems and skipCount parameters. I have assumed you are using the CMIS API as you do not say .....

Andy

Highlighted
Member II

Re: select with latest modification date

Yes, I am using CMIS API.

Thanks for the hint.

Krzysztof