// Note: not Documents, but this.Documents, because of the editing package (?) this.Documents = new Mongo.Collection("documents"); if (Meteor.isClient) { Template.editor.helpers({ docid: function () { let doc = Documents.findOne(); return doc ? doc._id : undefined; } }); Template.date_display.helpers({ current_date: function () { return new Date(); } }); } if (Meteor.isServer) { Meteor.startup(function () { // startup code that creates a document in case there isn't one yet. if (!Documents.findOne()) { Documents.insert({ title: "my new document" }); } }); }