Package com.mongodb.client.model
Class InsertManyOptions
java.lang.Object
com.mongodb.client.model.InsertManyOptions
The options to apply to an operation that inserts multiple documents into a collection.
- Since:
- 3.0
- MongoDB documentation
- Insert Tutorial
- Insert Command
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbypassDocumentValidation
(Boolean bypassDocumentValidation) Sets the bypass document level validation flag.Sets the comment for this operation.Sets the comment for this operation.Gets the bypass document level validation flagboolean
Gets whether the documents should be inserted in the order provided, stopping on the first failed insertion.ordered
(boolean ordered) Sets whether the server should insert the documents in the order provided.toString()
-
Constructor Details
-
InsertManyOptions
public InsertManyOptions()
-
-
Method Details
-
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 documents should be inserted in order
-
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
Gets the bypass document level validation flag- Returns:
- the bypass document level validation flag
- Since:
- 3.2
- Since server release
- 3.2
-
bypassDocumentValidation
Sets the bypass document level validation flag.For bulk operations use:
BulkWriteOptions.bypassDocumentValidation(Boolean)
- Parameters:
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.- Returns:
- this
- Since:
- 3.2
- Since server release
- 3.2
-
getComment
- Returns:
- the comment for this operation. A null value means no comment is set.
- Since:
- 4.6
- Since server release
- 4.4
-
comment
Sets the comment for this operation. A null value means no comment is set.For bulk operations use:
BulkWriteOptions.comment(String)
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 4.6
- Since server release
- 4.4
-
comment
Sets the comment for this operation. A null value means no comment is set.For bulk operations use:
BulkWriteOptions.comment(BsonValue)
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 4.6
- Since server release
- 4.4
-
toString
-