Hello,
I am trying to do https://www.meteor.com/tutorials/blaze/collections tutorial. But for some reason I am not able to reflect the data to my page.
The only difference is that on the tutorial, it is using a default package setup whereas I used the --full flag when I created the project.
I did what the tutorial said, create the collections file in imports/api and then import it in server/main.js
I have also added some entries to the tasks collection. For some reason, I am not able to get the data from the server to my template page. I have no errors whatsoever on the browser.
I am using constellation and it says I don’t have any values retrieved from tasks.
this is a bit frustrating since the intermediate video tutorials worked without having to import specifics but now I’m lost. not really sure what the issue is
Just to add, when I enable autopublish on constellation, my data suddenly appears.
imports/ui/pages/home/home.js >>>>>>>>>>>>>>>>>>>>>>
import { Template } from 'meteor/templating';
import { Tasks } from '/imports/api/tasks.js';
import './home.html';
Template.App_home.onRendered(function () {
console.log(Tasks.find({}).count());
});
Template.App_home.helpers({
tasks() {
return Tasks.find({});
},
});
imports/api/tasks.js >>>>>>>>>>>>>>>>>>>>>>
import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/mongo';
export const Tasks = new Mongo.Collection('tasks');
server/main.js >>>>>>>>>>>>>>>>>>>>>>
import '/imports/startup/server';
import '/imports/startup/both';
import '../imports/api/tasks.js';