I’m running into an issue where when I perform a find() call within an autorun and cursor through the data, the data is incorrect. This is on a site I pushed using mupx.
Here’s the code snippet:
var handle = Meteor.subscribe('invoices');
Tracker.autorun(() => {
if (handle.ready) {
var invoices = Invoices.find({txnId:this.txnId}).zone();
}
});
I outputted the txnId that I’m using within the find and it’s correct. When I perform the query within mongo shell I get this:
{ "_id" : "660144980016392150", "date" : "2017-03-20", "time" : "19:54:01", "authCode" : "902810", "txnId" : "147182-0_11", "status" : "Paid", "cart" : { }, "chargeTotal" : "450.00", "owner" : "" }
Is the minimongo and mongo out of sync? Doesn’t the handle.ready ensure that the subscription is synced?
I should mention I’m running Angular2; not sure if that matters.
Thanks for the help!