When JSON is the document format for databases, there shall always be some
need to define PartialOrd and Ord for JSON formated values. More specifically
we may need to figure out the following details -
Sort order for different types - null, bool, number, string, array, object.
Sort order for bool - false values sort before true values.
Sort order for float
NaN sort before negative-infinity.
negative-infinity sort before all floating point values.
positive-infinity sort after all floating point values.
For Strings, Unicode sort order or binary sort order.
Should array size sort before array elements.
Should object size sort before object elements.
Minbound and Maxbound, especially useful when JSON is used in range queries.
When JSON is the document format for databases, there shall always be some need to define PartialOrd and Ord for JSON formated values. More specifically we may need to figure out the following details -