Package com.mongodb.client.model
Class InsertManyOptions
-
- com.mongodb.client.model.InsertManyOptions
-
public final class InsertManyOptions extends
The options to apply to an operation that inserts multiple documents into a collection.- Since:
- 3.0
- MongoDB documentation
-
-
Constructor Summary
Constructors Constructor Description InsertManyOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InsertManyOptions
bypassDocumentValidation)
Sets the bypass document level validation flag.getBypassDocumentValidation()
Gets the the bypass document level validation flagboolean
isOrdered()
Gets whether the documents should be inserted in the order provided, stopping on the first failed insertion.InsertManyOptions
ordered(boolean ordered)
Sets whether the server should insert the documents in the order provided.toString()
-
-
-
Method Detail
-
isOrdered
public boolean isOrdered()
Gets whether the documents should be inserted in the order provided, stopping on the first failed insertion. The default is true. If false, the server will attempt to insert all the documents regardless of an failures.- Returns:
- whether the the documents should be inserted in order
-
ordered
public InsertManyOptions ordered(boolean ordered)
Sets whether the server should insert the documents in the order provided.- Parameters:
ordered
- true if documents should be inserted in order- Returns:
- this
-
getBypassDocumentValidation
@Nullable public getBypassDocumentValidation()
Gets the the bypass document level validation flag- Returns:
- the bypass document level validation flag
- Since:
- 3.2
- Since server release
-
bypassDocumentValidation
public InsertManyOptions bypassDocumentValidation(@Nullable bypassDocumentValidation)
Sets the bypass document level validation flag.- Parameters:
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.- Returns:
- this
- Since:
- 3.2
- Since server release
-
toString
public toString()
- Overrides:
in class
-
-