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

Add missing decoder case for NaN #251

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

danieka
Copy link
Contributor

@danieka danieka commented Sep 3, 2024

When running against our Mongo instance we got the following error:

%FunctionClauseError{module: BSON.Decoder, function: :type, arity: 2, kind: nil, args: nil, clauses: nil}

Turns out that, at least for our Mongo installation, this case is used for NaN. I have validated that the value is NaN in Mongo Compass and adding this case results in the document being deserialised to the same values as in Compass.

@zookzook
Copy link
Owner

zookzook commented Sep 4, 2024

This is interesting. Could you provide the version of the MongoDB? The only different is, that the sign bit is set to 1.

@zookzook zookzook merged commit c6c3c95 into zookzook:master Sep 4, 2024
3 of 4 checks passed
@zookzook
Copy link
Owner

zookzook commented Sep 4, 2024

Thank you!

@danieka
Copy link
Contributor Author

danieka commented Sep 6, 2024

@zookzook We use MongoDB 7.3.3 Enterprise, but this could also be related to the library we use for writing to Mongo, but I don't know what we use there.

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

Successfully merging this pull request may close these issues.

2 participants