查找文档在Mongodb集群中的位置,

用户名

我不得不将一百万个文档存储到Mongodb中。Mongodb集群由4个分片,1个mongos和1个配置服务器组成。

如何获取文档的详细信息,例如:

  1. 哪个分片包含文档?
  2. 哪个块包含文档?
3ppps

嗨,您可以使用expalain()查找文档的位置

查找文档位置的步骤

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格式的结果,在其中寻找分密钥。更多细节检查链接

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章