@sashko I’ve been doing this recently, but now I can’t access that collection on the browser console. Is that supposed to be the case? Also, it seems slower which makes me feel like minimongo isn’t being used.
Yes, and tested that both the client and the server methods are being called. Can’t figure out where the latency is coming from, but only started happening today after I moved to modules.
You could at least mention that there is an alternative, since Astronomy is in some peoples (plural since I think there are more than me ) view preferrable?
Is the Lists.deny lines in the code above from Todos necessary? I thought all collections were deny by default as long as the insecure package is not installed.
I have a ValidatedMethod that updates a collection document. Only the document author should be able to make updates. I tried to implement the editableBy helper from the todos example using dburles:collection-helpers as recommend in the Guide’s Collection helpers section.
const project = Projects.findOne({ _id: projectId });
if (!project.editableBy(this.userId)) {
throw new Meteor.Error('Projects.methods.edit.unauthorized', 'Only author can edit a project.');
}
ValidatedMethod turns on undocumented option in Meteor to avoid calling the server-side implementation if the simulation throws an error.
I realized that the findOne in my code above would only work on the server. On the client it would always return null and throw and error which would block the server code. As a fix, I just wrapped the above code with !this.isSimulation
How does the Todos example work, because it doesn’t use isSimulation?