Skip to content

Instantly share code, notes, and snippets.

@SkylerRogers
Last active August 29, 2015 14:13
Show Gist options
  • Save SkylerRogers/6dff5d8890be13f14a2a to your computer and use it in GitHub Desktop.
Save SkylerRogers/6dff5d8890be13f14a2a to your computer and use it in GitHub Desktop.
See all hits to MongoDB inside irb
# 1. Paste this in console
def show_mongo_db_operations
if Moped.logger == Rails.logger
Moped.logger = Logger.new($stdout)
true
else
Moped.logger = Rails.logger
false
end
end
# 2. Call show_mongo_db_operations
# 3. Run some operations to see details..
YourModel.create_indexes
YourModel.last.update_attributes! name: "Test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment