-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deeply nested JSON values are rearranged by json.set #4397
Comments
Sorry, I do not consider it a bug unless you prove that arrays are rearranged. For key/value objects - the spec does not guarantee order and Redis's behavior is implementation specific. Please do not rely on it. |
I assume that you're referring to the json spec? Can you please provide the reference? JSON is sometimes used to back a user interface in which case the order can be critical. I suppose I could stop using json.set and just use set and save it as a string blob. |
See https://stleary.github.io/JSON-java/index.html for example: |
I see that you added and merged code to allow a string blob. FWIW, I took your comment to heart and added code to the data API to sort the JSON that's used for the UI into the original based on a template. |
Great! I am closing this issue then. |
Describe the bug
While I can't provide a sample at this time, storing a complex JSON document using:
json.set key $ '{.......}'
Rearranges the document.
To Reproduce
I will try to create a sample JSON document that isn't proprietary to follow up later.
Expected behavior
Redis stores the document exactly as set.
Environment (please complete the following information):
Reproducible Code Snippet
Additional context
The text was updated successfully, but these errors were encountered: