[Answered ]-Django ORM annotate query with length of JSONField array contents

1👍

I found a solution in this Django ticket:

Map.objects.annotate(num_locations=Func('locations', function='jsonb_array_length', output_field=IntegerField()))

Leave a comment