-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Scala: Ensure implicit conversion keeps type fidelity #627
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
Conversation
When converting from a BsonDocument to org.bson.Document the scala driver previously used json. The implementation should not rely on the json output format, but rather use the Codecs to do the conversion. JAVA-3916
driver-scala/src/test/scala/org/mongodb/scala/ScalaPackageSpec.scala
Outdated
Show resolved
Hide resolved
val bsonDocument = Document( | ||
"null" -> BsonNull(), | ||
"int32" -> BsonInt32(32), | ||
"int64" -> BsonInt64(64L), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change 64L
-> Long.MaxValue
for reproducing issue in JIRA ticket.
FYI, I am OP of the bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
"null" -> BsonNull(), | ||
"int32" -> BsonInt32(32), | ||
"int64" -> BsonInt64(Long.MaxValue), | ||
"decimal128" -> BsonDecimal128(128), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I would explicitly pass 128.1 as with BsonDouble.
When converting from a BsonDocument to org.bson.Document the scala driver previously used json. The implementation should not rely on the json output format, but rather use the Codecs to do the conversion. JAVA-3916
When converting from a BsonDocument to org.bson.Document
the scala driver previously used json. The implementation
should not rely on the json output format, but rather use
the Codecs to do the conversion.
JAVA-3916