2017-01-23 58 views

回答

4

使用Mongo模板。

Criteria find = Criteria.where("company").is("Random"); 
Query query = new Query().addCriteria(find).with(new Sort(Sort.Direction.DESC, "reportDate")); 
BasicDBObject result = mongoOperations.findOne(query, BasicDBObject.class, "collection_name"); 

使用蒙戈庫

Report findTopByCompanyOrderByReportDateDesc(String company) 
相關問題