I have a model with a JSONField and need to select just the objects that have a certain value somewhere nested in the jsonb.
From the Django documentation I understand you can use contains
but the Postgres @>
operator for containment does not recurse into the structure.
I'd like to use @? '$.** ? (@.mykey == "myValue")'
to filter. myKey
and myValue
are literals in my code, they are not user input.