I don't understand why this cursor returns a zero count:
Template.productList.helpers({
'products': function() {
return Products.find({}, {transform: function(doc) {
console.log(ProductsLocations.find({product_id: doc._id}).count());
return doc;
}});
}
});
When I console.log()
it without .count()
I get an object I can traverse in Chrome Dev Tools.
The values exist in the database and doc._id
is a valid ID