I have a Model with a JSON Field.
data = JSONField(default=dict)
Is there an efficient way - or queryset filter - to find all instances of this Model that do not have a speicfic key in the json field.
Django documentation includes has_key function for JSON field.
Essentially i'm looking for a way to do not_has_key
My current method:
queryset = MyObj.objects.all()
for obj in queryset:
if 'my_key' not in obj.data:
do_work()
else:
pass
#key_already_exists
Many thanks