开发者

MongoMapper examine query

开发者 https://www.devze.com 2023-04-09 04:28 出处:网络
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 (

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号