Implement min function of aggregation plugin and test