jjzjj

CustomDocument

全部标签

mongodb - findOne 实现在升级到 mongo-java-driver 3.3.0 时发生了变化

我们之前使用的是mongo-java-driver3.0.4,在某个代码块中有这个实现-DBCollectiondocCollection=mongoClient.getDB(dbName).getCollection(collectionName);MapdocMap=doc.toMap();//wheredocistheCustomDocumentDBObjectcurrentObj=docCollection.findOne(newQueryBuilder().put("id").is(doc.getId()).get());if(currentObj==null){docCol