Suppose I have a jsonfield with data
from django.contrib.postgres.fields import JSONField
class Foo(models.Model):
json_field = JSONField(default=dict)
json_field = {
'bar': [1,2,3,4]
}
I'd like to filter data where bar
has array length greather than 3
Something like the following, Foo.objects.filter(json_field__bar__length__gt=3)