一.使用limit和skip进行分页查询 public List<User> pageList(int pageNum ,int pageSize){ List<User> userList = new ArrayList<>(); Mongo mg = new Mongo(); DB db = mg.getDB("data"); DBCollection coll = db.getCollection("t_user"); DB
public Page<Recorded> getRecordeds(Integer page, Integer size, Recorded recorded) { if (page<1){ page=1; } Sort sort = new Sort(Sort.Direction.DESC,"createTime"); Pageable pageable = new PageRequest(page-1,size,sort); Query query = new