mongodb notes ---- java connection mongodb page

As previously https://www.cnblogs.com/tk55/p/11090829.html

 

Ascending conditions, 5 records per second page

             //
             FindIterable<Document> findIterable = collection.find(new BasicDBObject("dates", new BasicDBObject("$gte", sdf.parse("2019-06-1 00:24"))
                                                                                                              .append("$lte",sdf.parse("2019-06-26 16:24")))
                                                                                             .append("title", "title"))
                                                                 .sort(Filters.eq("dates", 1))
                                                                 .limit(5)
                                                                 .skip(5);

 

 

Guess you like

Origin www.cnblogs.com/tk55/p/11091042.html