Skip to content

Complex objects in queries or updates fail to convert #197

@rlodge

Description

@rlodge

Given an object like this:

    public static class MockObject {
        @Id
        @ObjectId
        public String id;
        public Custom custom;
        public Map<URI, String> uriStringMap;
    }

and an update statement like this:

        coll.updateOne(
            Filters.eq(obj.id),
            Updates.combine(
                Updates.set("custom", obj.custom),
                Updates.set("uriStringMap", obj.uriStringMap)
            ),
            new UpdateOptions().upsert(true)
        );

The mongo driver will fail to find a useful mapping from URI to String because the map inside the $set clause isn't passed through Jackson, it's converted by the default Codecs.

Modify the JacksonCodecRegistry to use Jackson for more of the conversions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions