question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

update failed: Access denied. Operator $setOnInsert not allowed in a restricted collection.

See original GitHub issue

Hey 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 screen shot 2017-06-08 at 11 58 57

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
hexspritecommented, Jul 20, 2017

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.

2reactions
hexspritecommented, Jul 3, 2017

Seems like the proper thing to do would be to modify the Meteor allow-deny package to support $setOnInsert as be included in ALLOWED_UPDATE_OPERATIONS

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found