有很多示例如何使用 mongo 文档 从 JSON 字符串创建 BSON 对象和其他但我找不到如何创建一个带有链接(DBRef)的文档到另一个像这样的东西private static final MessageFormat USER_DBREF = new MessageFormat("DBRef('organizationEntity', ObjectId('{}'))");...Document doc = Document.parse(json);doc.put("organizationEntity", USER_DBREF.format(new Object[]{organizationEntity.getId()}));
添加回答
举报
0/150
提交
取消