在Mongodb集群中查找文档的位置,
我不得不在Mongodb中存储一百万个文档。Mongodb集群由4个碎片、1个mongos和1个配置服务器组成 如何获取文档的详细信息,如:在Mongodb集群中查找文档的位置,,mongodb,sharding,Mongodb,Sharding,我不得不在Mongodb中存储一百万个文档。Mongodb集群由4个碎片、1个mongos和1个配置服务器组成 如何获取文档的详细信息,如: 哪个碎片包含文档 哪个区块包含文档 查找您可以使用的文档的位置 查找文档位置的步骤 1. Open Mongos terminanl 2. Switch to your databse 3. find document of which you want to search location using explain() eg db.collect
查找您可以使用的文档的位置 查找文档位置的步骤
1. Open Mongos terminanl
2. Switch to your databse
3. find document of which you want to search location using explain()
eg db.collection.find({"x":1234}).explain()
您将获得json格式的结果,在其中查找碎片。更多详细信息检查