我有一些班级活动:@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 时,它们之间有什么区别?
添加回答
举报
0/150
提交
取消