I ended up using the JSONB_EXTRACT_PATH function (I am using Postgres), 
although it's a pity not to be able to use KeyTransform in this situation.

Il giorno lunedì 27 dicembre 2021 alle 10:59:22 UTC+1 Mariusz Felisiak ha 
scritto:

> Hi,
>
> Integers (and strings that can be cast to integers) on the first-level are 
> always interpreted as index transforms in arrays (as documented 
> <https://docs.djangoproject.com/en/dev/topics/db/queries/#key-index-and-path-transforms>)
>  
> because you can store a JSON array in the JSONField. Unfortunately, you 
> have to use a custom database function or  RawSQL() to get this data. 
> Please also take into account that KeyTransform() is an undocumented 
> transformation (ticket #26511 
> <https://code.djangoproject.com/ticket/26511>). 
>
> Best,
> Mariusz
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/141d7fc0-e10f-459c-a24a-61006e4462d9n%40googlegroups.com.

Reply via email to