我有一些班級活動:@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
提交
取消