Open bkhkcm opened 2 months ago
In my partition metric I want to access a nested JSON field.
public function calculate(NovaRequest $request) { return $this->count($request, User::class, 'meta->notifications->newsletters'); }
However, I don't get any correct data back.
If I make a query directly to the database:
SELECT JSON_UNQUOTE(JSON_EXTRACT(meta, '$.notifications.newsletters')) AS opt, COUNT(*) as aggregate FROM users GROUP BY opt;
Do I get the following data:
It seems that in the file /vendor/laravel/nova/src/Metrics/Partition.php, when calling the function formatAggregateResult, an empty string is passed for $key.
formatAggregateResult
Description:
In my partition metric I want to access a nested JSON field.
However, I don't get any correct data back.
If I make a query directly to the database:
SELECT JSON_UNQUOTE(JSON_EXTRACT(meta, '$.notifications.newsletters')) AS opt, COUNT(*) as aggregate FROM users GROUP BY opt;
Do I get the following data: