N1QL and Total Record Count for Paging

The totoal counts will not available until you process all possible records. That will be waste of resources.
Application should do two separate queries first do count and then do pagination.