使用mongomapper执行服务器runCommand geoNear
我非常想使用 此处讨论的 mongo geoNear 命令。
这是我在 Rails 控制台中输入的命令以及附带的错误消息。
MongoMapper.database.command({ 'geoNear' => "trips", 'near' => [45,45]})
Mongo::OperationFailure: Database command 'geoNear' failed:
(errmsg: 'more than 1 geo indexes :('; ok: '0.0').
我无法理解该错误消息,据说不可能有超过 1 个地理索引,而且我确信我只创建了一个。
基于这个stackoverflow问题 我相信我对查询的措辞是正确的。有人理解该错误消息吗?我将如何销毁并重新创建索引?
我正在使用 Rails 3.1 和 mongodb v2.0 以及 mongo ruby gem v1.5.1。
I would very much like to use the mongo geoNear command as discussed here.
Here is the command I entered in my rails console with the accompanying error message.
MongoMapper.database.command({ 'geoNear' => "trips", 'near' => [45,45]})
Mongo::OperationFailure: Database command 'geoNear' failed:
(errmsg: 'more than 1 geo indexes :('; ok: '0.0').
I can not make sense of the error message, it is supposedly impossible to have more than 1 geo index and I am certain that I have only created one.
Based on this stackoverflow question I believe I am wording the query correctly. Does anyone understand that error message? How would I go about destroying and recreating my indexes?
I am using rails 3.1 with mongodb v2.0 and the mongo ruby gem v1.5.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真的问得太早了,也许我应该删除它?不知何故,实际上地理索引太多了,因为删除索引并重新创建它可以解决问题。
I really asked this too soon, maybe I should delete it? Somehow there were in fact too many geo indexes, because deleting the index and recreating it fixed the problem.