#32411: Case-insensitive lookups on JSONField doesn't work on MySQL.
-------------------------------------+-------------------------------------
Reporter: elonzh | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: JSONField mysql | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by elonzh):
Replying to [comment:8 Simon Charette]:
> > the problem is the authors fields is a list and Django does not
support filter it
>
> That little to do with this ticket though. The ORM has no way of
''knowing'' `authors` is a JSON Array because `JSONField` are schema less.
If you want to filter out papers that have at least one author with a
matching name you'll have to use the MySQL equivalent of PostgreSQL
`json_array_elements` and a subquery through a `Func` expression but
that's something you should ask about on
[https://docs.djangoproject.com/en/3.1/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help support channels].
Yes, that little to do with this ticket. I just want to tell Carlton
Gibson that he has given the wrong solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/32411#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.f5cc87d1c6ae9af68224d3e8f61b2faf%40djangoproject.com.