[SERVER-24310] Adding NULL sort order configuration when using sort() queries Created: 29/May/16  Updated: 25/Sep/23

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Pavel Duchovny Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 22
Labels: storch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-5065 a missing field nested within an arra... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

At the moment, the NULL order fetching is decided upon the sort query type (DESC,ASC).

If the query is done on field X in a DESC order the NULLs of field X will be presented last, while in an ASC order the NULLs of field X will be presented first. I saw many requests on having the ability to decide the fetch positions of the NULLs in the ordered field.

Can it be added as an optional flag to the query syntax with a default behavior?



 Comments   
Comment by Ellen Louie [ 23/Mar/23 ]

Going to have to implement a workaround for this. Please prioritize this issue.

Comment by Attila Pix [ 02/Nov/21 ]

+1 Been doing workarounds for quite a while now, can this be prioritized?

Comment by Kumar Reddy [ 28/Jun/21 ]

We have requirement to sort all null values at the bottom always irrespective of sort order. Is there any ETA for this feature?

Comment by Smetkica Prah [ 28/Nov/20 ]

Is there any update on this? Like previously mentioned, this would be super helpful for good UX. Currently, we have to hack around it.

Comment by Martin Morcate [ 06/Nov/18 ]

+1 Very useful.

Comment by Wayne Uong [ 22/May/18 ]

Is there an ETA for this feature? This is so crucial for good UX/UI.

Comment by Jim Pedid [ 12/Dec/17 ]

Very important for my company for sorting values to the bottom alphabetically.

Comment by Asya Kamsky [ 31/May/16 ]

This would be analogous to SQL syntax: "ORDER BY fieldname NULLS FIRST" (or LAST).

Generated at Thu Feb 08 04:05:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.