How I can check w开发者_C百科hich query will be send to the MongoDB server when I call a certain association on my model from the Rails console ?
turn on MongoMapper logging in your connection string (typically in an initializer file):
MongoMapper.connection = Mongo::Connection.new('localhost', 27017, :logger => Rails.logger) #the logger param does the trick
精彩评论