Mysql 5.7 native json support - control keys order in json_insert function

后端 未结 2 595
名媛妹妹
名媛妹妹 2021-01-12 10:39

I am facing issues with json key ordering while inserting using json_insert function.

I have the sorted records as below

\"AIR\", \"AIR Express\"

\"

2条回答
  •  自闭症患者
    2021-01-12 10:57

    That's sad, but at now is no way to keep original keys order.

    Normalization, Merging, and Autowrapping of JSON Values

    The normalization performed by MySQL also sorts the keys of a JSON object (for the purpose of making lookups more efficient). The result of this ordering is subject to change and not guaranteed to be consistent across releases. In addition, extra whitespace between keys, values, or elements in the original document is discarded.

提交回复
热议问题