cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find a number of documents ?

pwer21c_
Champ on-the-rise
Champ on-the-rise

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

1 ACCEPTED ANSWER

Laurent_Doguin
Star Collaborator
Star Collaborator

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.

View answer in original post

4 REPLIES 4

Laurent_Doguin
Star Collaborator
Star Collaborator

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.

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.

pwer21c_
Champ on-the-rise
Champ on-the-rise

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

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