Not all valid pipeline expression operators listed in popup for `update`.
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.
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 ?
I really don't know for sure, but I wonder if any aggregation pipeline operator is allowed inside an update aggregation pipeline.