'ERROR Mongo::OperationFailure' from Cucumber testing with rails on mongoid-gridfs

耗尽温柔 提交于 2021-02-05 02:50:07

问题


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}

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.


回答1:


Maybe this error not occur now. one year after



来源:https://stackoverflow.com/questions/4551556/error-mongooperationfailure-from-cucumber-testing-with-rails-on-mongoid-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!