vert-x3 / vertx-mongo-client

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

the generated default _id value type is string, not ObjectId ? #302

Closed darrenweb closed 1 year ago

darrenweb commented 1 year ago

When saving data to db, the generated default _id value type is string, not ObjectId. Did you design this on purpose? Or is it a bug? Below is my code.

mongoClient.save("test", new JsonObject().put("v", "vertx"), mongo -> {});

20230428171836

tsegismont commented 1 year ago

Most probably the client is configured with useObjectId set to true.

See https://vertx.io/docs/vertx-mongo-client/java/#_configuring_the_client