From 9fc233d488ca37810d4ab7c9fc7d327433656da9 Mon Sep 17 00:00:00 2001 From: henadzit Date: Wed, 5 Feb 2025 22:44:10 +0100 Subject: [PATCH] Update docs --- docs/query.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/query.rst b/docs/query.rst index 75cc7975b..d7aba8442 100644 --- a/docs/query.rst +++ b/docs/query.rst @@ -285,7 +285,7 @@ PostgreSQL and SQLite also support ``iposix_regex``, which makes case insensive obj = await DemoModel.filter(demo_text__iposix_regex="^hello world$").first() -In PostgreSQL, ``filter`` supports additional lookup types: +In PostgreSQL, for ``JSONField``, ``filter`` supports additional lookup types: - ``in`` - ``await JSONModel.filter(data__filter={"breed__in": ["labrador", "poodle"]}).first()`` - ``not_in`` @@ -301,6 +301,13 @@ In PostgreSQL, ``filter`` supports additional lookup types: - ``istartswith`` - ``iendswith`` +In PostgreSQL, for ``ArrayField``, the following lookup types are available: + +- ``contains`` - ``await ArrayFields.filter(array__contains=[1, 2, 3]).first()`` which will use the ``@>`` operator +- ``contained_by`` - will use the ``<@`` operator +- ``overlap`` - will use the ``&&`` operator +- ``len`` - will use the ``array_length`` function, e.g. ``await ArrayFields.filter(array__len=3).first()`` + Complex prefetch ================