from the rails console, how can I easily query a mongo collection with nice tab style output in a human readable form:
Person.all.each { |p| pp p }
that will return a mess of each document printed one after the other, but none of the cols are lined up.
AFAIK you have a couple options:
Be content without columns and use pp or the very pretty awesome_print. With awesome_print I often do: ap Person.all.map(&:to_mongo)
The to_mongo
method will produce nicer output than pp'ing or ap'ing the object itself.
Roll your own. Check out terminal-table as a place to start.