Can I create a single N1QL query that returns the documents as well the count of documents ?
How efficient it would be compared to issuing separate queries for each ?
Can I create a single N1QL query that returns the documents as well the count of documents ?
How efficient it would be compared to issuing separate queries for each ?
COUNT is aggregate. So you can’t return the documents with count unless you use ARRAY_AGG(), which can be memory consuming.
You can use resultCount as count if you are not using pagination.
OR do separate queries.
I found this earlier reply, that that works for me.