I am doing something wrong in my Meteor app but simply cannot find out what it is. I'm not receiving any data in the UI. Here's the code.
lib/common.js
Data = new Meteor.Collection('data2');
'data2' is a collection I created and responds fine in mongo shell
server/app.js
Meteor.publish("Data", function() {
return Data.find({});
});
client/app.js
Meteor.subscribe("Data");
client/helpers.js
Template.home.helpers({
results: function(){
return Data.find();
}
});
I've even tried with specifying the two columns-field1, 2 in find() to no avail.
client/home.html
<template name="home">
<table class="table table-striped tablesorter z-depth-5">
<thead>
<tr>
<th width="15%">field1</th>
<th width="15%">field2</th>
</tr>
</thead>
<tbody>
{{#each results}}
<tr>
<td>{{field1}}</td>
<td>{{field2}}</td>
</tr>
{{/each}}
</tbody>
</table>
Inspection findings -
Data.find().fetch()
[]