我有一些课堂活动:
@Data
@Document(collection = "event")
public class Event {
private String id;
private List<Type> types;
}现在,我想获得所有在类型中包含某些Type实例的事件。我可以用MongoRepository类编写两个方法:
List<Event> findByTypesContaining(List<Type> type, Pageable pageable);或
List<Event> findByTypesIn(List<Type> type, Pageable pageable);两者都是作品。当我不得不使用...Containing和...In时,它们之间有什么区别?
发布于 2019-10-07 12:32:03
https://stackoverflow.com/questions/58268381
复制相似问题