cancel
Showing results for 
Search instead for 
Did you mean: 

select with latest modification date

longinus
Champ in-the-making
Champ in-the-making

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 4

afaust
Legendary Innovator
Legendary Innovator

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
Champ in-the-making
Champ in-the-making

Cool, thanks.

Any way to limit the results collection to one record?

andy1
Star Collaborator
Star Collaborator

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
Champ in-the-making
Champ in-the-making

Yes, I am using CMIS API.

Thanks for the hint.

Krzysztof