-
Notifications
You must be signed in to change notification settings - Fork 136
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
Improve performance by allow unordored HashMap #205
Comments
One thing to note is that unlike JSON, BSON is an ordered format. This is necessary for certain cases of usage in MongoDB drivers; for example, when sending a command to the server, the first key is always the name of the command. If the name of the command was not the first key, the server would at best return an error due to an invalid command name. Because of this, it wouldn't be possible for the driver to depend on the BSON library with a |
🤕 I think the documentation never mention it, but now you say it, it's obvious. I will add this to my fictional list (still short 😄) of design choice of mongo that make me sad. Guess there is not much to do so, BSON crate is primary used for mongo and I agree mongo driver starting to mix both version would be annoying to use. #136 look to allow more flexibility, probably more verbose, the code need some doc for me to fully understand the possibility. |
I also have the |
Toml crate have a
preserve_order
feature to handle case where it's desired to keep order of field. While bson already handle this it could be nice to have ano_preserve_order
feature, this could increase performance if preserve order is a cost (I assume it is).The text was updated successfully, but these errors were encountered: