Fixed #31691 -- Added ordering support to JSONBAgg.

This commit is contained in:
John Parton 2020-06-12 09:55:22 -05:00 committed by Mariusz Felisiak
parent e0cdd0fcf5
commit a8473b4d34
4 changed files with 53 additions and 2 deletions

View file

@ -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``
-------------