Skip to content

Order of elements not preserved #16

@stedolan

Description

@stedolan

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"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions