New answers tagged

0

Here is some information related to your questions. In my sharded cluster of version 4.2, one collections is sharded on _id where _id is just a default ObjectId. I'm seeing multiple documents with same _id on different shards' primaries. It is possible, but not common. See the following from this post: Is it possible to have duplicate _id in a shard zone? ...


0

As workaround you can run this query: db.getSiblingDB("config").chunks.aggregate([ { $match: { ns: "news.articles" } }, { $group: { _id: { shard: "$shard", ns: "$ns" }, chunks: { $sum: 1 } } }, { $group: { _id: "$_id.ns", shards: { $push: { shard: "$_id.shard", chunks: "$chunks" } ...


0

You need to add data to the collection. Only then the system can tell "how" data is shared. Before that, the collection is not sharded.


Top 50 recent answers are included