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.
1
vote
![](https://secure.gravatar.com/avatar/d1b2da4d09566b6a9d1fcfaeb15d4acb?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)