group() public method
Performs aggregation using Mongo "group" command.
public array group ( $keys, $initial, $reduce, $options = [] )$keys mixed
Fields to group by. If an array or non-code object is passed, it will be the key used to group results. If instance of \MongoDB\BSON\Javascript passed, it will be treated as a function that returns the key to group by. $initial array
Initial value of the aggregation counter object. $reduce \MongoDB\BSON\Javascript|string
Function that take