the index created in mongo database
Field in the entity
@Indexed(name = "2dsphere")
private Point location;
This field in mongo db
"location":
{ "type": "Point",
"coordinates":
[ 41.035137, 28.98953 ]
}
Try to retrieve entity from mongo db
repository.findById(id).orElse(null) throws the below error
ex.getMessage(): Expected to read Document Document{{type=Point, coordinates=[41.015137, 28.97953]}} into type class com.mongodb.client.model.geojson.Point but didn't find a PersistentEntity for the latter!