https://localhost:3000/api/posts?sort=priority
Tried doing this with an
optional propertycalled
priority
. It seems to sort it properly, but only for docs with the values. The ones that don't have it
(undefined), don't go to the end of the array for some reason...
Where do the ones that have it
undefined
end up? Interspersed? Missing?
The
undefined
are on the first of the list.
So to me, an
undefined
value is considered lower and falsy - therefore considered
firston an ascending sort.
Can you cite any precedent for having
undefined
at the end of the list?
I'm not able to turn up examples of how other frameworks handle this for comparison.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.