Description
What is the best to map scala.math.BigDecimal
to NumberDecimal
instead of binary?
I created a repo with this example and currently it looks like that:
case class TypeWithBigDecimal(x: BigDecimal, y: BigDecimal)
TypeWithBigDecimal(x = 103234.42343, y = 12344.423)
{"x": {"$binary": {"base64": "AmdTOqcAAAAF", "subType": "00"}}, "y": {"$binary": {"base64": "ALxcZwAAAAM=", "subType": "00"}}}
From what I see, this is currently hardcoded in all of of the Bson outputs, so I guess the only way would be to create your own output implementation, isn't it?
https://github.com/AVSystem/scala-commons/blob/master/commons-mongo/jvm/src/main/scala/com/avsystem/commons/mongo/BsonValueOutput.scala#L39
https://github.com/AVSystem/scala-commons/blob/master/commons-mongo/jvm/src/main/scala/com/avsystem/commons/mongo/BsonWriterOutput.scala#L26
https://github.com/AVSystem/scala-commons/blob/master/commons-mongo/jvm/src/main/scala/com/avsystem/commons/mongo/BsonWriterOutput.scala#L63
Are you planning to make it configurable?
Regards,
Paweł Ulewicz.