Aggregation Framework : return data as array or object based on config setting