efcore.pg icon indicating copy to clipboard operation
efcore.pg copied to clipboard

EF.Functions support for json_array_length

Open alastair-todd opened this issue 10 months ago • 2 comments

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;

alastair-todd avatar Apr 15 '24 14:04 alastair-todd