update failed: Access denied. Operator $setOnInsert not allowed in a restricted collection.
See original GitHub issueHey guys! I’m getting this error while trying to update profile.name
on clientside:
update failed: Access denied. Operator $setOnInsert not allowed in a restricted collection.
Here is my profile.name
schema (no autoValue or defaultValue!)
name: {
type: String,
label: "Nimi",
optional: false,
custom: function () {
if (!this.value)
return 'required';
}
},
…and here is the demonstration on chrome console
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (1 by maintainers)
Top Results From Across the Web
update failed: Access denied. Operator $setOnInsert not ...
I'm getting this error while trying to update profile.name on clientside: ... Operator $setOnInsert not allowed in a restricted collection.
Read more >Meteor Upsert Restricted Collection 403 Error - Stack Overflow
errorClass {error: 403, reason: "Access denied. Upserts not allowed in a restricted collection."…} I don't really understand what happens, here ...
Read more >$setOnInsert — MongoDB Manual
Starting in MongoDB 5.0, mongod no longer raises an error when you use an update operator like $setOnInsert with an empty operand expression...
Read more >Cannot insert into Collection - help - Meteor forums
I have a collection , that I am trying to insert a message object into. However, the code seems to freeze where it...
Read more >How to findAndInsertOrModify in one statement ?
(Because the update() with upsert only performs an update, MongoDB ignores the $setOnInsert operation and only applies the $set operation.).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just in case anyone runs into this issue I can confirm that simply copying the allow-deny package from Meteor dev and modifying it to allow $setOnInsert is a good workaround. Sometime soon I’ll submit a PR to Meteor if they don’t fix it first.
Seems like the proper thing to do would be to modify the Meteor
allow-deny
package to support$setOnInsert
as be included inALLOWED_UPDATE_OPERATIONS