I am using mongoid_grid gem to store my files. It is working fine on development but while running cucumber test I am getting this error:
Database command 'filemd5' failed: {"errmsg"=>"exception: best guess plan requested, but scan and order required: query: { files_id: ObjectId('4d8728605835068603000024') } order: { files_id: 1, n: 1 } choices: { $natural: 1 } ", "code"=>13284, "ok"=>0.0}
I also tried
db.fs.chunks.ensureIndex({files_id:1, n:1}, {unique: true});
but it does not seem to work. When I run one scenario at a time the tests pass but when I run all of them once they fail with above error. Am I missing something here?