mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #31691 -- Added ordering support to JSONBAgg.
This commit is contained in:
committed by
Mariusz Felisiak
parent
e0cdd0fcf5
commit
a8473b4d34
@@ -86,10 +86,21 @@ General-purpose aggregation functions
|
||||
``JSONBAgg``
|
||||
------------
|
||||
|
||||
.. class:: JSONBAgg(expressions, filter=None, **extra)
|
||||
.. class:: JSONBAgg(expressions, filter=None, ordering=(), **extra)
|
||||
|
||||
Returns the input values as a ``JSON`` array.
|
||||
|
||||
.. attribute:: ordering
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
An optional string of a field name (with an optional ``"-"`` prefix
|
||||
which indicates descending order) or an expression (or a tuple or list
|
||||
of strings and/or expressions) that specifies the ordering of the
|
||||
elements in the result list.
|
||||
|
||||
Examples are the same as for :attr:`ArrayAgg.ordering`.
|
||||
|
||||
``StringAgg``
|
||||
-------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user