Package com.mongodb.client.model
Class InsertOneOptions
- java.lang.Object
 - 
- com.mongodb.client.model.InsertOneOptions
 
 
- 
public final class InsertOneOptions extends Object
The options to apply to an operation that inserts a single document into a collection.- Since:
 - 3.2
 - MongoDB documentation
 - Insert Tutorial
 - Insert Command
 - Since server release
 - 3.2
 
 
- 
- 
Constructor Summary
Constructors Constructor Description InsertOneOptions() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InsertOneOptionsbypassDocumentValidation(Boolean bypassDocumentValidation)Sets the bypass document level validation flag.BooleangetBypassDocumentValidation()Gets the the bypass document level validation flagStringtoString() 
 - 
 
- 
- 
Method Detail
- 
getBypassDocumentValidation
@Nullable public Boolean getBypassDocumentValidation()
Gets the the bypass document level validation flag- Returns:
 - the bypass document level validation flag
 
 
- 
bypassDocumentValidation
public InsertOneOptions bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.- Parameters:
 bypassDocumentValidation- If true, allows the write to opt-out of document level validation.- Returns:
 - this
 
 
 - 
 
 -