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 returnthisso that a chaining style can be used.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description InsertManyOptions()Creates a new options wrapperInsertManyOptions(InsertManyOptions that)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BooleanbypassDocumentValidation()Gets whether to bypass document validation, or null if unspecified.InsertManyOptionsbypassDocumentValidation(Boolean bypassDocumentValidation)Sets whether to bypass document validation.Stringcollection()Returns the alternate collection to use for the operation.InsertManyOptionscollection(String collection)Sets the alternate collection to use for the operation.InsertManyOptionscomment(String comment)InsertManyOptionscomment(BsonValue comment)BooleangetBypassDocumentValidation()Deprecated, for removal: This API element is subject to removal in a future version.InsertManyOptionsgetOptions()Deprecated, for removal: This API element is subject to removal in a future version.booleanisOrdered()Deprecated, for removal: This API element is subject to removal in a future version.InsertManyOptionsoptions()InsertManyOptionsordered(boolean ordered)Sets whether the server should insert the documents in the order provided.WriteConcernwriteConcern()The write concern to use.InsertManyOptionswriteConcern(WriteConcern writeConcern)Set the write concern to use.
-
-
-
Constructor Detail
-
InsertManyOptions
public InsertManyOptions()
Creates a new options wrapper
-
InsertManyOptions
@MorphiaInternal public InsertManyOptions(InsertManyOptions that)
- Parameters:
that- the options to copy- Since:
- 2.0
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Method Detail
-
bypassDocumentValidation
public InsertManyOptions bypassDocumentValidation(Boolean 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
public InsertManyOptions collection(@Nullable String collection)
Description copied from interface:dev.morphia.internal.CollectionConfigurableSets the alternate collection to use for the operation.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<InsertManyOptions>- Parameters:
collection- the name of the collection to use- Returns:
- this
-
collection
@Nullable public String collection()
Description copied from interface:dev.morphia.internal.CollectionConfigurableReturns the alternate collection to use for the operation. Might return null.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<InsertManyOptions>- Returns:
- the collection name or null
-
bypassDocumentValidation
@Nullable public Boolean bypassDocumentValidation()
Gets whether to bypass document validation, or null if unspecified. The default is null.- Returns:
- whether to bypass document validation, or null if unspecified.
- Since server release
- 3.2
-
comment
public InsertManyOptions comment(String comment)
- Parameters:
comment- the comment- Returns:
- this
- Since:
- 2.3
- See Also:
InsertManyOptions.comment(String)
-
comment
public InsertManyOptions comment(BsonValue comment)
- Parameters:
comment- the comment- Returns:
- this
- Since:
- 2.3
- See Also:
InsertManyOptions.comment(BsonValue)
-
getBypassDocumentValidation
@Nullable @Deprecated(forRemoval=true, since="2.3") public Boolean getBypassDocumentValidation()
Deprecated, for removal: This API element is subject to removal in a future version.Gets whether to bypass document validation, or null if unspecified. The default is null.- Returns:
- whether to bypass document validation, or null if unspecified.
- Since server release
- 3.2
-
writeConcern
public InsertManyOptions writeConcern(@Nullable WriteConcern writeConcern)
Description copied from interface:dev.morphia.internal.WriteConfigurableSet the write concern to use.- Specified by:
writeConcernin interfacedev.morphia.internal.WriteConfigurable<InsertManyOptions>- Parameters:
writeConcern- the write concern- Returns:
- this
-
writeConcern
@Nullable public WriteConcern writeConcern()
Description copied from interface:dev.morphia.internal.WriteConfigurableThe write concern to use. By default the write concern configured for the MongoCollection instance will be used.- Specified by:
writeConcernin interfacedev.morphia.internal.WriteConfigurable<InsertManyOptions>- Returns:
- the write concern, or null if the default will be used.
-
getOptions
@Deprecated(forRemoval=true, since="2.3") public InsertManyOptions getOptions()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the driver version of this instance
-
isOrdered
@Deprecated(forRemoval=true, since="2.3") public boolean isOrdered()
Deprecated, for removal: This API element is subject to removal in a future version.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
-
options
@MorphiaInternal public InsertManyOptions options()
- Returns:
- the driver version of this instance
- Since:
- 2.3
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
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
-
-