Ok, figured out the issue myself.
I was calling this code:
Storage storage = storageService.findDocsWithQueryPagingOrderBy("db_name", "collection_name", query, 0, 0, "key_name", OrderByType.ASCENDING);
int docCount=storage.jsonDocList.size();
The 4th parameter - which is the number of documents to retrieve, is "0", which actually causes to retrieve, attention, ALL documents from the collection, in my case it was 3169!
As soon as i replaced the 4th parameter with "1", like below:
Storage storage = storageService.findDocsWithQueryPagingOrderBy("db_name", "collection_name", query, 1, 0, "key_name", OrderByType.ASCENDING);
and used
pvpOnlinePlayers=storage.getRecordCount()
I got super fast execution (because only 1 document was retrieved) and a correct answer on number of documents that stasify the given query. So to summarize:
1. Use storage.getRecordCount() to retrieve number of documents that satisfy the query
2. Devs, please analyze the possible bug which results in extracting ALL documents from collection when 4th param is 0.