Re: JSON query help
| От | Gavin Henry |
|---|---|
| Тема | Re: JSON query help |
| Дата | |
| Msg-id | CAA8_NKCE7zdEthiDRPi5xG=wcG8RFe82RocOf8EhGk6t-pFx9g@mail.gmail.com обсуждение исходный текст |
| Ответ на | JSON query help (Gavin Henry <gavin.henry@gmail.com>) |
| Ответы |
Re: JSON query help
|
| Список | pgsql-novice |
Got a bit close now:
cgrates=# select
cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'BalanceUUID'
as balance from cdrs where cost > 0 limit 1;
-[ RECORD 1 ]-----------------------------------
BalanceUUID | "154419f2-45e0-4629-a203-06034ccb493f"
so I can AND this with cost > 0 AND
cost_details->'AccountSummary'->'BalanceSummaries'
@>'[{"ID":"B_MONETARY_POSTPAID"}]' limit 10;
now I just need to use the first select which returns a SET to loop
through BalanceSummaries to match on BalanceUUID = UUID
Any pointers?
В списке pgsql-novice по дате отправления: