我有一些课堂活动:
@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);
两者都是作品。当我必须使用...包含和...输入时,它们之间有什么区别?