I have simple template which renders on a specific route. It has a subscription of patient collection.Before 1.3 I could write any find().fetch() to view my subscription data. But in 1.3 i’m getting patient is not defined error.
note that, in the corresponding template js file, i’ve the template html file imported and also that patient collection along with schema imported.
His collections were defined inside the imports folder and were defined as export let CollectionName so no globals existed and as such the console couldn’t see them. To solve his immediate need to use the console to debug the collection, we attached the Patients collection to the window variable in the template onCreate helper method (window.Patients = Patients) this allowed Fysal to to temporarily use the console to debug the collection.
Thank you @floydprice for your in person help. Just to let all know for future references,
We cannot actually see our data through console straight forwardly unless we make some changes. Let’s say I have a collection Patients and if we want to see our data ( for debug purpose ), we need to do something like this
Template.templateName.onCreated(function(){ window.Patients = Patients; // Patients collection should be in the import list first. });
I was also thinking the same way, earlier before the Meteor 1.3 when the imports directory isn’t introduced we generally put the collections in the common directory ( so that it’s available in server and client) both, but now with imports in place. So we now have to explicitly import the Collections on the client side, for minimongo to work ? is it so, or we have the client side collections either way ? @floydprice@zahed