(21 February 2014) Version 1.2.5: Thanks to @nitindhar7: Adds a sort option, so you can be more choosy with your limit.
(05 December 2013) Version 1.2.4: Thanks to @jmargeta: Bugfix for newer mongo versions that don't support the JSON object.
(01 September 2013) Version 1.2.3: Thanks to @rugbyhead: Now handles query-based filtering.
(03 November 2012) Version 1.2.2: Thanks to @kmcgrath: Added support for db_name, allowing people using admin authentication to specify a db name to use, since they must connect to the admin db.
(29 July 2012) Version 1.2.1: Fixed bug with occurrence calculation.
(28 July 2012) Version 1.2: Removed map/reduce to avoid certain bugs, which also simplified some of the calculations.
(03 June 2012) Thanks to @wfreeman, we now handle MaxDepth, and other goodies.
(25 May 2012) Thanks to @wfreeman, we now recognize the Date, ObjectID and BinData types.