Hey all! I'm playing around with sorting using pri...
# orm-help
m
Hey all! I'm playing around with sorting using prisma client. I have a field which can either be null or a date. When sorting on this field, is there some way I can get it to treat Null as the largest item rather than the smallest? i.e.
Copy code
null
28/02/2019
null
22/02/2019
24/02/2019
null
Would be ordered ASC:
Copy code
22/02/2019
24/02/2019
28/02/2019
null
null
null
I'm a bit stumped with this. Any idea of where to start would be greatly appreciated!
h
@Martin Hunt I think this is a expected behaviour as I don't think null should get highest priority. You will require to manually modify the data
m
Yea I totally understand why it works this way, it's just not very useful in certain circumstances and when working with mysql directly you could do something like https://stackoverflow.com/questions/1498648/sql-how-to-make-null-values-come-last-when-sorting-ascending
I'm wondering if there's a way to do that with prisma