来自 Cucumber 测试的“错误 Mongo::OperationFailure"在 mongoid-gridfs 上使用导轨 [英] 'ERROR Mongo::OperationFailure' from Cucumber testing with rails on mongoid-gridfs

查看:43
本文介绍了来自 Cucumber 测试的“错误 Mongo::OperationFailure"在 mongoid-gridfs 上使用导轨的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行黄瓜测试时遇到了这个奇怪的错误:

I am getting this weird error while running cucumber test:

ERROR Mongo::OperationFailure: Database command 'filemd5' failed: {"errmsg"=>"exception: best guess plan requested, but scan and order required: query: { files_id: ObjectId('4d1abab3a15c84139c00006e') } order: { files_id: 1, n: 1 } choices: { $natural: 1 } ", "code"=>13284, "ok"=>0.0}

我有一个类似场景的列表,其中第一个场景通过但所有其他后续场景都失败了.我搜索了一下,发现索引有问题.但是,我不确定要写什么查询.此外,我可以在开发的 mongo 上添加查询.我想确保索引也在测试中完成.如果有人对此有任何想法,请随意.

I have a list of similar scenarios, where first scenario passes but all the other following scenario fails. I searched for it and I found that there is problem with indexing. But, I am not sure about what query to write. Furthermore, I can add the query on the mongo of the development. I want to make sure that the indexing is done in test too. If anyone has any idea on this, feel free.

推荐答案

现在可能不会出现这个错误.一年后

Maybe this error not occur now. one year after

这篇关于来自 Cucumber 测试的“错误 Mongo::OperationFailure"在 mongoid-gridfs 上使用导轨的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆