Skip to content
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

Order of elements not preserved #16

Open
stedolan opened this issue May 19, 2017 · 0 comments
Open

Order of elements not preserved #16

stedolan opened this issue May 19, 2017 · 0 comments

Comments

@stedolan
Copy link

When a document is encoded and then decoded, the order of elements is reversed.

# open Bson
# let d = empty
  |> add_element "a" (create_string "a")
  |> add_element "b" (create_string "b");;
val d : Bson.t = <abstr>
# print_endline (to_simple_json d);;
{"b" : "b", "a" : "a"}
- : unit = ()
# print_endline (to_simple_json (decode (encode d)));;
{"a" : "a", "b" : "b"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant