How can I find a number of documents ?

Hello, In nuxeo studio, after execution of nxql query, how can I get a number of results ?

ex : Execution of nxql query :

fetch > query : SELECT * FROM Document WHERE mydocumenttype:variable= DATE '@{CurrentDate.format(“yyyy-MM-dd”)}' and ecm:path='@{Document.parent.path}/'

And then,

number of results ?

Sincerely yours

0 votes

2 answers

3134 views

ANSWER



Hi,

after the query operation operation, the input for the next operation is a document list. So if you use for instance the Execution Context > Set Context Variable , you can put this as value: @{This.size()} This being the input of the operation.

0 votes



Note that this is going to be quite slow as it returns all the documents. It would be better to use an operation based on the CoreSession.queryAndFetch API, but there isn't one today.
02/13/2013


thanks. Another question about this. If a query has not the result (NULL), nuxeo give me a error message or 0 ?

The last question is about convert string. How can I convert this integer type(this.size()) to string type in nuxeo studio ?

Thanks a lot

0 votes



Please ask questions as new questions or updates to your original questions, not in the answers section.
02/16/2013