Meteor App MongoDB cursor not returning correct number of data

running this

let _get_resp = Jobs_status_identifier.find({});
console.log(_get_resp.count());
console.log(_get_resp.fetch().length);

got this

I20171129-06:01:38.405(0)? 1421
I20171129-06:01:47.855(0)? 865

Just to confirm, Jobs_status_identifier is the collection, right?

yeah, that’s why there’s a number of data returns :smiley:

Is "complete_details.address.state" an array? Maybe that part of the query is causing your results to vary. I wonder what your results will be if you add the appropriate fields filter? https://docs.meteor.com/api/collections.html#fieldspecifiers

That’s only a string. I don’t think that’s the issue, as you see the result was being pulled correctly, and how to prove that? Using the .count() method and for sure it’ll works also using the rawCollection. The issue here is on how the .fetch() function handle the result from the database. I’m guessing it re-reads the where statement in that function and unfortunately it interpreted it in a wrong way…

Or maybe wasn’t able to wait the data from mongodb? We have more than 20k data in db so maybe that’s the issue?

Is it an object or a string in your schema? I don’t think a string should have dot notation in a query?? I suggested the fields filter because I’ve noticed its helped to make some query results more accurate when it comes to arrays and probably objects as well.

Don’t worry about that, I’ve posted a version above without where statement, and still the same result.

Any thoughts on this?