I have a model Document that has a json field "metadata" containing a dictionary of different values. One example:
{"Orientation": "Landscape", "Address": "Bethany Home Road", "Photo Type": "Many People", "a boolean": false, "Person": ["Sam Smith", "Hank Jones"], "Date": "05/13/2018", "Location": "Washington DC", "Decade": "2020"} I can write a query to find all the record(s) in the Document table that the "Person" field contains "Sam Smith" like this Document.objects.filter(metadata__Person__contains='Sam Smith') Is there a way to write a query to find all the Documents that have "Sam*" in the metadata field? For example, if there were another document that had "Sammy Jacobs" in the "Person" field, the query would return both that record and the record with the "Sam Smith" in the Person field. Either some sort of "or" condition within the query that would allow me to search for "Sam Smith" or "Sammy Jacobs". Or, some sort of regex that I can put in for the search criteria that says search for all the "Sam*" occurrences in the "Person" list. I have been googling for a solution, but have not found one yet. Thanks! Mark -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2Pwb8-cHXF%2B7oHkgkuG2QSr%3D%3DvQmNAN0_%2B_8ro5H9ThHQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.