select with latest modification date

cancel
Showing results for 
Search instead for 
Did you mean: 
longinus
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
afaust
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

longinus
Member II

Re: select with latest modification date

Cool, thanks.

Any way to limit the results collection to one record?

andy1
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

longinus
Member II

Re: select with latest modification date

Yes, I am using CMIS API.

Thanks for the hint.

Krzysztof