3
@Document
class Entity1 {
@Id
String id
@DbRef(lazy=true)
Entity2 entity2;
String test;
}
mongoTemplate.upsert(
new Query(Criteria.where("entity2.$id").is(entity2Id),
new Update().set("test", "newValue"),
Entity1.class);
我Found $id field without a $ref before it, which is invalid
如何UPSERT MongoDB的文档使用DBREF春天mongoTemplate
我的问题是:如何做到这一点UPSERT与DBREF。
嗨,大家好,如果你要downvote我的问题,请至少发表评论和告诉我为什么,谢谢 – Jaiwo99