I have 60k+ data on my app, but if I execute Books.find().count() many times on google chrome console, the results are increasing until reached real total data,
so how to count data faster as I execute ‘db.getCollection(‘books’).find().count()’ on mongo console
What you are seeing is minimongo synchronizing the data from the server to the client, which takes the longer the more documents you have. The size of the documents also matters.
For example, I have a collection with a lot of large documents in it. When I want my client to have access to that collection, I only sync the title field. When the client needs access to the entire document, it will get published it in it’s entirety.
You should probably also think about paging. In order to get the total number of books, you would need a method
that way you can call this method on the client, and it will immediately return {ready: false, count: 0} from the stub, and then the callback from the server will give you the true total.