Topics.update( {slug: topicSlug}, { $addToSet: { posts: result } });
When I try to update a document using the slug attribute instead of _id, I get the following error:
"Error: Not permitted. Untrusted code may only update documents by ID. [403]"
I understand why this error gets thrown, but what is the preferred workaround to update a single document selected by slug instead of _id?
Topics.update( {slug: topicSlug}, { $addToSet: { posts: result } });
When I try to update a document using the slug attribute instead of _id, I get the following error: "Error: Not permitted. Untrusted code may only update documents by ID. [403]"
I understand why this error gets thrown, but what is the preferred workaround to update a single document selected by slug instead of _id?