vertx-mongo-client icon indicating copy to clipboard operation
vertx-mongo-client copied to clipboard

Unable to insert JsonObject with BigDecimal attribute in it.

Open naveedh27 opened this issue 5 years ago • 3 comments

java.lang.IllegalStateException: Unknown BsonType for '-0.0002623000'
        at io.vertx.ext.mongo.impl.codec.json.AbstractJsonCodec.writeValue(AbstractJsonCodec.java:83) ~[]
        at io.vertx.ext.mongo.impl.codec.json.AbstractJsonCodec.lambda$writeDocument$1(AbstractJsonCodec.java:261) ~[]

mongotest.zip

I am trying to convert JavaObject to JsonObject and trying to persist in Mongo. I am able to convert JavaObject to JsonObject with the help of JsonObject.mapFrom()

After converting when I try to persist in Mongo, BSONDocument is not supporting BigDecimal.

I have attached maven project to replicate the issue.

naveedh27 avatar Jan 30 '20 11:01 naveedh27

The version of the driver you're using? I assume the zip file contains a sample code?

karianna avatar Jan 31 '20 04:01 karianna

The version of the driver - mongodb-driver-async - 3.10.1 I assume the zip file contains a sample code - Yes. Zip file has sample code. You can replicate the issue

naveedh27 avatar Jan 31 '20 06:01 naveedh27

@naveedh27 Can you try again with the latest vertx Mongo client (nightly) - we've swapped to reactive streams and the support should be there now

karianna avatar May 12 '20 12:05 karianna