Open wolfogre opened 6 years ago
https://blog.wolfogre.com/posts/trap-of-update-on-sharding-mongodb/
upsert:true 的情况, 虽然 mongos 知道 _id 是唯一的, 但是 _id 不是分片键, mongos 不清楚 _id 落在哪个分片上, 如果在所有 shard 实例上执行这条语句, 可能会导致每个 shard 都插入数据
https://blog.wolfogre.com/posts/trap-of-update-on-sharding-mongodb/