FindIterable <Document> how to get summary records as a result of a query
I used the mongo driver for java 2.x and passed 3.1.
DBCursordeprecated and I had to use a structure FindIterable<Document>.
When I execute the request
FindIterable<Document> cursor=(mongo).getCollection().find(findArgs).limit(10).skip(0);
I would like to get a counter of the total number of records in the result set with query search in only one query.
How to get a counter without executing another request? I'm not talking about 10 entries in the limit, but about the total number of entries.
I want to fulfill one request for invoice and search. I do not want to search and count.
thanks
+6
6 answers