ReactiveMongo 0.13.0 incorrectly handles Decimal128

34 views
Skip to first unread message

Daniel Slapman

unread,
Apr 13, 2018, 8:58:46 AM4/13/18
to ReactiveMongo - http://reactivemongo.org
Hello. After 0.13.0 update I discovered, that byte order of Decimal128 written by reactivemongo is wrong.

The following code (runnable with ammonite)
The following code (runnable with ammonite)
import $ivy.`org.reactivemongo::reactivemongo:0.13.0`
import reactivemongo.api._
import reactivemongo.bson.buffer.ArrayBSONBuffer
import reactivemongo.bson.{BSONDecimal, BSONDocument}

val bd = BSONDecimal.parse("12.76")

val el = BSONDocument("d" -> bd.get)

val pack = BSONSerializationPack

val buffer = new ArrayBSONBuffer
pack
.writeToBuffer(buffer, el)

println
(buffer.array.map("%02X" format _).mkString)

prints 180000001364000000000000003C30FC0400000000000000 while BSON corpus gives 18000000136400FC040000000000000000000000003C3000 here


Any thoughts?


https://github.com/ReactiveMongo/ReactiveMongo/issues/740

Cédric Chantepie

unread,
Jun 4, 2018, 2:43:06 PM6/4/18
to ReactiveMongo - http://reactivemongo.org
Will have a look

Cédric Chantepie

unread,
Jun 6, 2018, 5:27:09 PM6/6/18
to ReactiveMongo - http://reactivemongo.org
Reply all
Reply to author
Forward
0 new messages