Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all valid pipeline expression operators listed in popup for update. #118

Open
rickhg12hs opened this issue Mar 3, 2022 · 2 comments

Comments

@rickhg12hs
Copy link
Contributor

The popups are very helpful while developing queries, but not all valid expression operators appear in the popup for the update method when using an aggregation pipeline. There may be others, but I noticed "$setIntersection" doesn't appear in the popup.

Here's a valid update method that works, but "$setIntersection" didn't appear in the popup while typing.

db.collection.update({},
[
  {
    "$set": {
      "discountItems": {
        "$setIntersection": [
          [
            "Just coffee",
            "Discount clothing"
          ],
          "$description"
        ]
      }
    }
  }
],
{
  "multi": true
})

Try it on mongoplayground.net.

@feliixx
Copy link
Owner

feliixx commented Mar 4, 2022

I based my list on operators listed here: mongodb update operator, but it looks like you can also use some of the aggregation operator in an update query ?
Do you know if there are other operator missing ?

@rickhg12hs
Copy link
Contributor Author

I really don't know for sure, but I wonder if any aggregation pipeline operator is allowed inside an update aggregation pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants