I am trying to make an extremely simple Meteor app that is almost exactly the same as the tutorial. I am simply trying to return all the elements from a collection. I am using autopublish.
My code looks like this. I am using coffeescript, but I tried using JavaScript and there was no change.
@Studies = new Mongo.Collection "studies"
if Meteor.isClient
console.log "Is client"
Template.find.helpers
studies: ->
console.log "client"
console.log Studies.find().fetch()
return Studies.find()
When I load the page, "client" is logged and "[]" is logged after. However, when I run mongo in terminal, I run "db.studies.find()" and what is returned is
{ "_id" : ObjectId("56601b66ab1ba5a30d2d94c7"), "title" : "study 1" }
What am I doing wrong? I really appreciate your help in advance, as I have been stuck on this for hours now.