Py学习  »  MongoDB

找不到类com.mongodb.client.model.geojson.Point的编解码器

Dima • 4 年前 • 302 次点击  

org.bson.codecs.configuration.codeconfigurationexception:找不到类com.mongodb.client.model.geojson.Point的编解码器。

import com.mongodb.client.model.geojson.Point;
import com.mongodb.client.model.geojson.Position;

@Test
public void test() throws Exception{
    BasicDBObject dbo = new BasicDBObject();
    dbo.put("name", "some-name");
    dbo.put("location", new Point(new Position(100, 200)));
    System.out.println(dbo.toJson());
}

我错过了什么?我只想看看Java驱动程序如何将对象序列化为JSON。(MongoDB java驱动程序3.8.0版)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/54363
 
302 次点击  
文章 [ 1 ]  |  最新文章 4 年前