Skip to content

SortArray does not support sorting simple array types (integer/string) #4929

Closed
@nathanukey

Description

@nathanukey

Referring to https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/

sorting of simple e.g. int array should be possible:

"$sortArray":
{
    "input": [ 1, 4, 1, 6, 12, 5 ],
    "sortBy": 1
}

however ArrayOperators.SortArray.by only accepts type Sort, which seems to always require a property. Not clear if any way to set a simple ASC/DESC order to sort by.

Seems simple feature that has been missed off, or if possible missed of documentation on how to achieve?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions