I am currently attempting to integrate a Collection into my Meteor.js project. I utilized a template from meteorkitchen and implemented some code:
Within my home.js file (located in the client folder), I have included the following code:
import { Mongo } from 'meteor/mongo';
Tasks = new Mongo.Collection('tasks');
Template.HomeSection2Content2.helpers({
tasks: function() {
return Tasks.find();
}
});
I can confirm that my home.html file is functioning properly, as when I substitute the code within the TemplateHelper with:
Template.HomeSection2Content2.helpers({
tasks: [
{ text: 'This is task 1' },
{ text: 'This is task 2' },
{ text: 'This is task 3' },
],
});
everything performs as expected.
Additionally, I have added
import { Mongo } from 'meteor/mongo';
Tasks = new Mongo.Collection('tasks');
to my server.js file.
However, when attempting to add an item through my MongoDB Shell to this collection, no changes are reflected on the FrontEnd. There are no error messages displayed either.