#26511: Document how to do a substring search in JSONField
--------------------------------------+------------------------------------
     Reporter:  eoinmurray            |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:  postgres, jsonb       |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by charettes):

 It looks like what we really need here is support for the `->>` operator
 as `(lhs -> key)::text` is the JSON representation of the string
 (`('"foo"'::jsonb)::text` yields `'"foo"'`).

 I believe this should be done by introducing a new expression for this
 purpose and documenting it.

 In the meantime we could document using `Func('data',
 template="%(expressions)s ->> 'hobby'", output_field=models.TextField())`.

--
Ticket URL: <https://code.djangoproject.com/ticket/26511#comment:10>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.501d31673d9b115ea78cc5512f607201%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to