Package dev.morphia
Class InsertManyOptions
java.lang.Object
dev.morphia.InsertManyOptions
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfigurable<InsertManyOptions>
,dev.morphia.internal.CollectionConfiguration
,dev.morphia.internal.WriteConfigurable<InsertManyOptions>
public class InsertManyOptions
extends Object
implements dev.morphia.internal.WriteConfigurable<InsertManyOptions>, dev.morphia.internal.CollectionConfigurable<InsertManyOptions>
Options related to insertion of documents into MongoDB. The setter methods return
this
so that a chaining style can be used.- Since:
- 1.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbypassDocumentValidation
(Boolean bypassDocumentValidation) Sets whether to bypass document validation.collection
(String collection) Sets the alternate collection to use for the operation.ordered
(boolean ordered) Sets whether the server should insert the documents in the order provided.writeConcern
(WriteConcern writeConcern) Set the write concern to use.
-
Constructor Details
-
InsertManyOptions
public InsertManyOptions()Creates a new options wrapper
-
-
Method Details
-
bypassDocumentValidation
Sets whether to bypass document validation.- Parameters:
bypassDocumentValidation
- whether to bypass document validation, or null if unspecified- Returns:
- this
- Since server release
- 3.2
-
collection
Sets the alternate collection to use for the operation.- Specified by:
collection
in interfacedev.morphia.internal.CollectionConfigurable<InsertManyOptions>
- Parameters:
collection
- the name of the collection to use- Returns:
- this
-
comment
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 2.3
- See Also:
-
comment
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 2.3
- See Also:
-
writeConcern
Description copied from interface:dev.morphia.internal.WriteConfigurable
Set the write concern to use.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<InsertManyOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-
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
-