标签: ruby-on-rails mongodb mongomapper
当我从Rails控制台调用模型上的某个关联时,如何检查将向MongoDB服务器发送哪个查询?
答案 0 :(得分:1)
打开连接字符串中的MongoMapper日志记录(通常在初始化程序文件中):
MongoMapper.connection = Mongo::Connection.new('localhost', 27017, :logger => Rails.logger) #the logger param does the trick