public final class InsertOptions extends Object
this so that a chaining style can be used.| Constructor | Description |
|---|---|
InsertOptions() |
| Modifier and Type | Method | Description |
|---|---|---|
InsertOptions |
bypassDocumentValidation(Boolean bypassDocumentValidation) |
Sets whether to bypass document validation.
|
InsertOptions |
continueOnError(boolean continueOnError) |
Set whether documents will continue to be inserted after a failure to insert one.
|
InsertOptions |
dbEncoder(DBEncoder dbEncoder) |
Set the encoder to use for the documents.
|
Boolean |
getBypassDocumentValidation() |
Gets whether to bypass document validation, or null if unspecified.
|
DBEncoder |
getDbEncoder() |
The encoder to use for the documents.
|
WriteConcern |
getWriteConcern() |
The write concern to use for the insertion.
|
boolean |
isContinueOnError() |
Whether documents will continue to be inserted after a failure to insert one (most commonly due to a duplicate key error).
|
InsertOptions |
writeConcern(WriteConcern writeConcern) |
Set the write concern to use for the insert.
|
public InsertOptions writeConcern(@Nullable WriteConcern writeConcern)
writeConcern - the write concernpublic InsertOptions continueOnError(boolean continueOnError)
continueOnError - whether to continue on errorpublic InsertOptions dbEncoder(@Nullable DBEncoder dbEncoder)
dbEncoder - the encoder@Nullable public WriteConcern getWriteConcern()
public boolean isContinueOnError()
@Nullable public DBEncoder getDbEncoder()
@Nullable public Boolean getBypassDocumentValidation()
public InsertOptions bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
bypassDocumentValidation - whether to bypass document validation, or null if unspecified