laravel-mongodb
laravel-mongodb copied to clipboard
I think we need to specific another column(s) when sum of column.
For example,
We assume we want to sum of "price" with "account_name". I can't get right now. You can take a look given example.
INPUT: ABCModel::select('account_name')->where('id', '=', $_id)->sum('price');
OUTPUT: 0 => [ "account_name" => "ACCOUNT A", "sum" => 333 ], 1 => [ "account_name" => "ACCOUNT B", "sum" => 85 ], 2 => [ "account_name" => "ACCOUNT C", "sum" => 51 ],