Understanding “Not permitted. Untrusted code may only update documents by ID.” Meteor error

From the Meteor blog: Changes to allow/deny rules Starting in 0.5.8, client-only code such as event handlers may only update or remove a single document at a time, specified by _id. Method code can still use arbitrary Mongo selectors to manipulate any number of documents at once. To run complex updates from an event handler, … Read more

How do you secure the client side MongoDB API?

While there is no documented way to do this yet, here’s some code that should do what you want: Foo = new Meteor.Collection(“foo”); … if (Meteor.is_server) { Meteor.startup(function () { Meteor.default_server.method_handlers[‘/foo/insert’] = function () {}; Meteor.default_server.method_handlers[‘/foo/update’] = function () {}; Meteor.default_server.method_handlers[‘/foo/remove’] = function () {}; }); } This will disable the default insert/update/remove methods. Clients … Read more

Meteor + Blaze – If else statement

Spacebars uses the same control flow structure as handlebars so the answer is the same as this one. In your case: {{#if en}} {{text.en}} {{else}} {{#if tc}} {{text.tc}} {{/if}} {{/if}} Side note – one of the nice things about jade is that it supports else if. Sometimes a better alternative is to move the logic … Read more

Cannot compile namespaces when the ‘–isolatedModules’ flag is provided

I faced similar issue in react + ts. I had commented out all my code. Turns out A global file cannot be compiled using ‘–isolatedModules’. Ensure your file contains imports, exports, or an ‘export {}’ statement. So, added something like: export const foo = ‘foo’; or export {} It’s a temporary solution, else you can … Read more

How to format date in meteor template

You may want to create a global helper like: Template.registerHelper(‘formatDate’, function(date) { return moment(date).format(‘MM-DD-YYYY’); }); Then you can use it like: {{#each vname}} {{formatDate date}} {{/each}} This solution depends on moment which is a handy date manipulation library. If you prefer to produce the string without using moment, there are a number of answers for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)