analyzer: changed api for aggregation from BSON to JSON