You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
OS: [ubuntu 22.04]
Kernel: Linux silverspore-host 6.8.0-49-generic Fix info command to use git version #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Containerized?: Yes, using docker compose and docker.dragonflydb.io/dragonflydb/dragonfly
Dragonfly Version: df-v1.25.1
Reproducible Code Snippet
# Minimal code snippet to reproduce this bug
Additional context
The text was updated successfully, but these errors were encountered:
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: A JSONObject is an unordered collection of name/value pairs...
yes, you can save as string. I submitted #4399 to allow querying strings json objects using json.get
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: