How can I see raw mongoDB queries with Mongoid

I think I got an answer. This is follow dsims answer and also from what I’ve seen in the documentation regarding logging.

I have an initialize file (config/initializers/mongoid.rb) and in there I have:

Mongoid.logger = Logger.new($stdout)
Mongo::Logger.logger = Logger.new($stdout)

It dumps out the mongo info the console. You probably want to change this for a production environment. But while developing I like to be able to see what the DB is doing. Especially because I’m brand new to MongoDb.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)