Current documentation about $sample is correct but does not adress sharded clusters: in this case the sample strategy is done independently on each shard, and mongoS will do a "random sort" on the merged streams.
- has to be done before
-
SERVER-68623 Executing $sample from mongos on sharded collection has unexpected behavior
- Closed