[英]How to query for documents with invalid references using spring data mongodb
Let's assume that we have collection A which references collection B through a field called "bref", which is an array of ObjectId's from collection B. For collection A, there are 4 possible situations that I am interested in: 假设我们有一个集合A,该集合通过一个称为“ bref”的字段引用了集合B,该字段是集合B中ObjectId的数组。对于集合A,我感兴趣的有4种情况:
In spring-data, using a MongoRepository, I was able to resolve the situations from above as follows: 在Spring数据中,使用MongoRepository,我能够从上面解决以下情况:
Questions: 问题:
尝试这个
Pageable<T> findByBrefNotIn(List<ObjectId> brefs, Pageable, pageable)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.