【问题标题】:explain() is not a functionexplain() 不是函数
【发布时间】:2017-04-03 21:42:11
【问题描述】:

使用 MongoDB v3.0.3。运行 db.grades.explain().find() 时遇到问题 - 我不断收到消息“TypeError: db.grades.explain is not a function (shell):1”

但是,我可以使用 db.grades.find().explain() - 但使用此方法返回的信息不如 collection.explain() 有用

【问题讨论】:

  • Robomongo 在与 MongoDB shell 的兼容性方面落后。它仍然基于 MongoDB 2.4.x 系列的构建,并且仍然使用 SpiderMonkey JavaScript 引擎。在 MongoDB 2.6 和更高版本中,引擎是 V8,并且很多集成逻辑已经改变。与 RoboMongo 相比,有很多帖子提到了当前 MongoDB shell 版本的不兼容性。

标签: mongodb robo3t


【解决方案1】:

原来,这是因为我使用的是 Robomongo(0.8.5 版),我只是假设你可以在 shell 中做的所有事情,你都可以在 Robomongo 中做,但显然不是。当我切换到使用命令行时,db.collection.explain() 工作得很好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-23
    • 2017-08-27
    • 2014-11-30
    • 1970-01-01
    • 2017-05-06
    • 2019-12-20
    • 1970-01-01
    • 2013-10-26
    相关资源
    最近更新 更多