One of the systems I've lately inherited makes heavy use of Mongo for data storage, a data system I've not used previously. So, when the boss called tonight and said that his boss needed counts of an object in our system by state in the next 10 minutes my thinking went something like...
No problem, that's a simple SQL group-by....Oh, wait. This is mongo. Oh, crap! How do I do that?! It's a function; Map...Something.