Class BaseWriteOperation

    • Constructor Detail

      • BaseWriteOperation

        public BaseWriteOperation​(MongoNamespace namespace,
                                  boolean ordered,
                                  WriteConcern writeConcern,
                                  boolean retryWrites)
        Construct an instance
        Parameters:
        namespace - the database and collection namespace for the operation.
        ordered - whether the writes are ordered.
        writeConcern - the write concern for the operation.
        retryWrites - if writes should be retried if they fail due to a network error.
        Since:
        3.6
    • Method Detail

      • getNamespace

        public MongoNamespace getNamespace()
        Gets the namespace of the collection to write to.
        Returns:
        the namespace
      • getWriteConcern

        public WriteConcern getWriteConcern()
        Gets the write concern to apply
        Returns:
        the write concern
      • isOrdered

        public boolean isOrdered()
        Gets whether the writes are ordered. If true, no more writes will be executed after the first failure.
        Returns:
        whether the writes are ordered
      • getBypassDocumentValidation

        public java.lang.Boolean getBypassDocumentValidation()
        Gets the the bypass document level validation flag
        Returns:
        the bypass document level validation flag
        Since:
        3.2
      • bypassDocumentValidation

        public BaseWriteOperation bypassDocumentValidation​(java.lang.Boolean 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