admin管理员组文章数量:1278652
I have this error but it does not specify which code line is faulty. Is there any way I can narrow down which codes I need to focus on?
Not sure if its a related problem, but when I submit a doc and its supposed to recognize my user.username
, but it es out blank when html displays {{author}}
.
The code for the collection (shared folder for both public/ server) is as below:
var post = _.extend(postAttributes, {
userId: user._id,
author: user.username
});
Do appreciate any help!
Update:
New error message after shifting the UserAccount codes into server folder.
Exception while simulating the effect of invoking 'postInsert'
"Match error: Unknown key in field message"
I have this error but it does not specify which code line is faulty. Is there any way I can narrow down which codes I need to focus on?
Not sure if its a related problem, but when I submit a doc and its supposed to recognize my user.username
, but it es out blank when html displays {{author}}
.
The code for the collection (shared folder for both public/ server) is as below:
var post = _.extend(postAttributes, {
userId: user._id,
author: user.username
});
Do appreciate any help!
Update:
New error message after shifting the UserAccount codes into server folder.
Exception while simulating the effect of invoking 'postInsert'
"Match error: Unknown key in field message"
-
"I have this error but it does not specify which code line is faulty." Then why is it pointing at
mongo.js:472
? It's telling you exactly what line is faulty. – Cerbrus Commented May 2, 2015 at 16:41 - @Cerbrus Apologies for the missing lines, have attached them – Thinkerer Commented May 2, 2015 at 16:47
2 Answers
Reset to default 9You have code on the client side that uses something that isn't an _id
as its query operator to update a document.
It is not possible to update on the client with a query like this. You can do these on the server though.
So if you have code like this somewhere, you run it without throwing the error you're getting:
MyCollection.update({ someName: someValue }, {$set:{something:true}});
You can do this though:
var doc = MyCollection.findOne({ someName: someValue });
MyCollection.update({ _id: doc._id }, {$set:{something:true}});
Here you explicitly define which document you would like to update. To find this code you might want to look for anything with .update
in it that can run on the client side.
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 plex updates from an event handler, just define a method with Meteor.methods and call it from the event handler.
Hope this helps :)
版权声明:本文标题:javascript - Uncaught Error: Not permitted. Untrusted code may only update documents by ID. [403] - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741289809a2370483.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论