Closed DemonicTutor closed 10 months ago
since this commit: https://github.com/eclipse-vertx/vert.x/commit/c59300aa8aebb0ac66bbfae3244616869c930d7a jackson-databind is optional
First time we want to use aggregate in one of our services.
aggregate
verts-mongo-client calls JsonObject's public static JsonObject mapFrom(Object obj) in some paths and in test scope the dependency is present.
public static JsonObject mapFrom(Object obj)
JsonObject.mapFrom(new JsonObject()); JsonObject.mapFrom(new LinkedHashMap<>()); JsonObject.mapFrom(Map.of("a", "b"));
throws io.vertx.core.json.DecodeException: Mapping java.util.Map is not available without Jackson Databind on the classpath
io.vertx.core.json.DecodeException: Mapping java.util.Map is not available without Jackson Databind on the classpath
mongo.aggregate("collection", new JsonArray(""" [ { "$group": { "_id": null, "myCount": { "$sum": 1 } } }, { "$project": { "_id": 0 } } ] """))
or
mongo.aggregate("collection", JsonArray.of( new JsonObject(""" { "$group": { "_id": null, "myCount": { "$sum": 1 } } } """), new JsonObject(""" { "$project": { "_id": 0 } } """) ))
mongo.aggregate("collection", JsonArray.of( JsonObject.of("$group", JsonObject.of("_id", null, "myCount", JsonObject.of("$sum", 1))), JsonObject.of("$project", JsonObject.of("_id", 0)) ))
Fixed by 1546a0f
Version
since this commit: https://github.com/eclipse-vertx/vert.x/commit/c59300aa8aebb0ac66bbfae3244616869c930d7a jackson-databind is optional
Context
First time we want to use
aggregate
in one of our services.Do you have a reproducer?
verts-mongo-client calls JsonObject's
public static JsonObject mapFrom(Object obj)
in some paths and in test scope the dependency is present.throws
io.vertx.core.json.DecodeException: Mapping java.util.Map is not available without Jackson Databind on the classpath
Steps to reproduce
or
or
Extra