mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #31691 -- Added ordering support to JSONBAgg.
This commit is contained in:
parent
e0cdd0fcf5
commit
a8473b4d34
4 changed files with 53 additions and 2 deletions
|
@ -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``
|
||||
-------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue