efcore.pg
efcore.pg copied to clipboard
EF.Functions support for json_array_length
I could be mistaken but EF.Functions
support for JSON appears limited.
I have a dynamic JSON column (no fixed POCO) which is storing an array of objects. Sometimes this is stored as an empty array, and I want to filter out those rows.
This is the working SQL, but I don't seem to be able to attain this using EF.Functions.
SELECT "Id", "Json"
FROM "Reporting"."ReportSnapshot"
where jsonb_array_length("Json") > 0;