Skip to content

Instantly share code, notes, and snippets.

@mtkd
Created August 9, 2010 20:22
Show Gist options
  • Save mtkd/516042 to your computer and use it in GitHub Desktop.
Save mtkd/516042 to your computer and use it in GitHub Desktop.
Enumerate MongoDB indexes with Mongoid
a = []
Mongoid.master.collections.each do |x|
x.index_information.map do |y|
a.push [y[1]["ns"], y[1]["name"], y[1]["key"].inspect, y[1]["unique"]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment