vert-x3 / vertx-mongo-client

Mongo Client for Eclipse Vert.x
http://vertx.io
Apache License 2.0
58 stars 98 forks source link

Unable to insert JsonObject with BigDecimal attribute in it. #223

Open naveedh27 opened 4 years ago

naveedh27 commented 4 years ago
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 ofJsonObject.mapFrom()

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

I have attached maven project to replicate the issue.

karianna commented 4 years ago

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

naveedh27 commented 4 years ago

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

karianna commented 4 years ago

@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