I am creating an application using ruby/grape and mongoid. But when I try to create or find a document in any collection using mongoid, for example with Admin.create
I get the following error:
ERROR Mongo::Error::OperationFailure: not authorized for query on databse.collection
I can log in to mongo console and create/find documents just fine with the credentials I use in mongoid.yml.
mongoid.yml:
production:
clients:
default:
database: my_db
hosts:
- myhost:port
username: db_user
password: my_password