/** * Gets the limit to apply. The default is 0, which means there is no limit. * * @return the limit * @mongodb.driver.manual reference/method/cursor.limit/#cursor.limit Limit */ public int getLimit() { return options.getLimit(); }
CountOperation operation = new CountOperation(getNamespace()) .skip(options.getSkip()) .limit(options.getLimit()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .collation(options.getCollation());
@Test public void passThrough() { Collation collation = Collation.builder() .locale("en") .caseLevel(true) .build(); DBCollectionCountOptions options = new CountOptions() .collation(collation) .hint("i'm a hint") .limit(18) .maxTime(15, TimeUnit.MINUTES) .readPreference(ReadPreference.secondaryPreferred()) .readConcern(ReadConcern.LOCAL) .skip(12) .getOptions(); assertEquals(collation, options.getCollation()); assertEquals("i'm a hint", options.getHintString()); assertEquals(18, options.getLimit()); assertEquals(15, options.getMaxTime(TimeUnit.MINUTES)); assertEquals(ReadPreference.secondaryPreferred(), options.getReadPreference()); assertEquals(ReadConcern.LOCAL, options.getReadConcern()); assertEquals(12, options.getSkip()); } }
/** * Gets the limit to apply. The default is 0, which means there is no limit. * * @return the limit * @mongodb.driver.manual reference/method/cursor.limit/#cursor.limit Limit */ public int getLimit() { return options.getLimit(); }
CountOperation operation = new CountOperation(getNamespace()) .skip(options.getSkip()) .limit(options.getLimit()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .collation(options.getCollation());