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 Details

    • InsertManyOptions

      public InsertManyOptions()
      Creates a new options wrapper
  • Method Details

    • 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)
      Sets the alternate collection to use for the operation.
      Specified by:
      collection in interface dev.morphia.internal.CollectionConfigurable<InsertManyOptions>
      Parameters:
      collection - the name of the collection to use
      Returns:
      this
    • comment

      public InsertManyOptions comment(String comment)
      Parameters:
      comment - the comment
      Returns:
      this
      Since:
      2.3
      See Also:
    • comment

      public InsertManyOptions comment(BsonValue comment)
      Parameters:
      comment - the comment
      Returns:
      this
      Since:
      2.3
      See Also:
    • writeConcern

      public InsertManyOptions writeConcern(@Nullable WriteConcern writeConcern)
      Description copied from interface: dev.morphia.internal.WriteConfigurable
      Set the write concern to use.
      Specified by:
      writeConcern in interface dev.morphia.internal.WriteConfigurable<InsertManyOptions>
      Parameters:
      writeConcern - the write concern
      Returns:
      this
    • 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