AnsweredAssumed Answered

return last object in a folder from a query?

Question asked by aweber1nj on Jun 29, 2012
Latest reply on Jun 29, 2012 by aweber1nj
So, from my early-learnings of CMIS and query-language, the lack of functions and joins is a bit of a drag…

In order to return the last/latest object in a folder, I know I can use the in_folder( ) expression, but I don't have a way to choose max( ) on a column, right?  (As an aside, I would have liked to have simply select max(cmis:objectId), but I don't think that's "safe" with Alfresco).

So what are my options here?  Select the objectId and lastModifiedDate from all the objects in the folder and keep track of which is the latest manually as I iterate through the entire result-set?  That's really pretty slow and sub-optimal when a database or index can perform the actual query on the server and return one result over the network instead of potentially thousands of results (and paging, etc.).

I hope I missed something that makes this a lot easier and more network-optimized than that.  Any ideas?

-AJ

Outcomes