The same issue can be reproduced in Cozo-Web 0.7.6
I understand that JSON spec does not require the key order to be preserved. I just think that it's better to leave the order unchanged, unless there is a strong benefit in reordering them to alphabetical. I'd support your design if you have already evaluated the performance implication and deliberately discarded the key order.
From a user perspective, it would be a nice property of the DB if the value is stable when I write some object and read it back.
For reference:
postgres json preserves object key order, though jsonb will discard the order.
serde_json has a preserve_order feature to toggle the behavior.
In Cozo-Node 0.7.6
The same issue can be reproduced in Cozo-Web 0.7.6
I understand that JSON spec does not require the key order to be preserved. I just think that it's better to leave the order unchanged, unless there is a strong benefit in reordering them to alphabetical. I'd support your design if you have already evaluated the performance implication and deliberately discarded the key order.
From a user perspective, it would be a nice property of the DB if the value is stable when I write some object and read it back.
For reference:
json
preserves object key order, thoughjsonb
will discard the order.serde_json
has apreserve_order
feature to toggle the behavior.