1.mongo库某个字段是数组或者集合,查询该字段同时包含多个特定值
Query dzUnitQuery = new Query(); //查询业务范围是数组,并且该数组同时包含多个特定值 String[] ywfwArray = {"0","1","2"}; dzUnitQuery.addCriteria(Criteria.where("IS_SK_DF").all(Arrays.asList(ywfwArray))); // 查询水库所有单位 List<SkUnitVo> roleUserList = mongoTemplate.find(dzUnitQuery, SkUnitVo.class);