Skip to content

Can't find a codec for class com.mongodb.client.model.geojson.Point #169

Open
@derwaldgeist

Description

@derwaldgeist

I'm trying to use MongoDB Mobile for GeoJSON data. Unfortunately, this does not seem to work out of the box. If I try to find a document based on a nearSphere query, I get this error:

org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class com.mongodb.client.model.geojson.Point.
        at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46)
        at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63)
        at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37)
        at com.mongodb.client.model.BuildersHelper.encodeValue(BuildersHelper.java:37)
        at com.mongodb.client.model.Filters$GeometryOperatorFilter.toBsonDocument(Filters.java:1209)
        at com.mongodb.internal.operation.Operations.createFindOperation(Operations.java:142)
        at com.mongodb.internal.operation.Operations.findFirst(Operations.java:125)
        at com.mongodb.internal.operation.SyncOperations.findFirst(SyncOperations.java:80)
        at com.mongodb.client.internal.FindIterableImpl.first(FindIterableImpl.java:199)

How can this codec be set-up?

Metadata

Metadata

Assignees

No one assigned

    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