/** * Sets the returnNew * * @param returnNew the returnNew * @return this */ public FindAndModifyOptions returnNew(final boolean returnNew) { options.returnNew(returnNew); return this; }
/** * Returns the returnNew * * @return the returnNew */ public boolean isReturnNew() { return options.returnNew(); }
.remove(remove) .update(update) .returnNew(returnNew) .upsert(upsert) .maxTime(maxTime, maxTimeUnit)
.remove(remove) .update(update) .returnNew(returnNew) .upsert(upsert) .bypassDocumentValidation(bypassDocumentValidation)
@Test public void passThrough() { Collation collation = Collation.builder() .locale("en") .caseLevel(true) .build(); DBCollectionFindAndModifyOptions options = new FindAndModifyOptions() .bypassDocumentValidation(true) .collation(collation).getOptions() .maxTime(15, TimeUnit.MINUTES) .projection(new BasicDBObject("field", "value")) .remove(true) .returnNew(true) .sort(new BasicDBObject("field", -1)) .update(new BasicDBObject("$inc", "somefield")) .upsert(true) .writeConcern(WriteConcern.JOURNALED); assertTrue(options.getBypassDocumentValidation()); assertEquals(collation, options.getCollation()); assertEquals(15, options.getMaxTime(TimeUnit.MINUTES)); assertEquals(new BasicDBObject("field", "value"), options.getProjection()); assertTrue(options.isRemove()); assertTrue(options.returnNew()); assertEquals(new BasicDBObject("field", -1), options.getSort()); assertEquals(new BasicDBObject("$inc", "somefield"), options.getUpdate()); assertTrue(options.isUpsert()); assertEquals(WriteConcern.JOURNALED, options.getWriteConcern()); } }
.projection(wrapAllowNull(options.getProjection())) .sort(wrapAllowNull(options.getSort())) .returnOriginal(!options.returnNew()) .upsert(options.isUpsert()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .projection(wrapAllowNull(options.getProjection())) .sort(wrapAllowNull(options.getSort())) .returnOriginal(!options.returnNew()) .upsert(options.isUpsert()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS)
/** * Sets the returnNew * * @param returnNew the returnNew * @return this */ public FindAndModifyOptions returnNew(final boolean returnNew) { options.returnNew(returnNew); return this; }
/** * Returns the returnNew * * @return the returnNew */ public boolean isReturnNew() { return options.returnNew(); }
.remove(remove) .update(update) .returnNew(returnNew) .upsert(upsert) .maxTime(maxTime, maxTimeUnit)
.remove(remove) .update(update) .returnNew(returnNew) .upsert(upsert) .bypassDocumentValidation(bypassDocumentValidation)
.projection(wrapAllowNull(options.getProjection())) .sort(wrapAllowNull(options.getSort())) .returnOriginal(!options.returnNew()) .upsert(options.isUpsert()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .projection(wrapAllowNull(options.getProjection())) .sort(wrapAllowNull(options.getSort())) .returnOriginal(!options.returnNew()) .upsert(options.isUpsert()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS)