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 go into the mongo console and create / find documents just with the credentials that I use in mongoid.yml.
mongoid.yml:
production:
clients:
default:
database: my_db
hosts:
- myhost:port
username: db_user
password: my_password
source
share