使用案例:我想将Point和Multipoint存储在同一个字段中。所以我在课堂上使用GeoGson接口:
@Id
private String id;
@Indexed(unique=true)
private int refk;
@GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
private GeoJson loc;
有了这个,我可以在同一个字段中保存Point和multipoint。 但是,当我查询文件时,它给了我错误:
Failed to instantiate org.springframework.data.mongodb.core.geo.GeoJson using constructor NO_CONSTRUCTOR