Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Nov 16, 2022

Support $documents on shards

The new aggregation operator $documents cannot be used together with $merge in a sharded cluster, you get an error: ``` db.aggregate([ { $documents: [ { _id: ObjectId("6616b08a610fab3e84d2d4ee"), a: 'foo', shardKey: 1 }, ] }, { $merge: { into: { db: 'myDB', coll: 'sharded_Collection' } } } ]) ``` raises ```$documents must run on mongoS, but cannot :: caused by :: $merge must run on a shard``` Having this new function available in every environment would we great.
  • Attach files