mongoDB and条件查询
Criteria criteria = Criteria.where("createTime").lte(new Date());
Query query = new Query();
if (bo.getScope() != null && bo.getScopeId() != null) {
criteria.and("scope").is(bo.getScope()).and("scopeId").is(bo.getScopeId());
}
query.addCriteria(criteria);
query.with(new Sort(Sort.Direction.DESC, "_id"));
List<Person> persons= meerkatMinMongoTemplate.find(query, Person.class);
还没有评论,来说两句吧...