query.addCriteria(Criteria.where("rootId").ne("ID值"));
List<AggregationOperation> operations = new ArrayList<>();operations.add(Aggregation.match(Criteria.where("rootId").is(null)));