Exception: Mongo::Error::UnchangeableCollectionOption

Inherits:
Mongo::Error
  • Object
show all
Defined in:
lib/mongo/error/unchangeable_collection_option.rb

Overview

Raised if a new collection is created from an existing one and options other than the changeable ones are provided.

Since:

  • 2.1.0

Constant Summary

Constants inherited from Mongo::Error

BAD_VALUE, CODE, CURSOR_NOT_FOUND, ERR, ERRMSG, ERROR, UNKNOWN_ERROR, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS

Instance Method Summary collapse

Constructor Details

#initialize(option) ⇒ UnchangeableCollectionOption

Create the new exception.

Examples:

Create the new exception.

Mongo::Error::UnchangeableCollectionOption.new(option)

Parameters:

  • option (String, Symbol)

    The option that was attempted to be changed.

Since:

  • 2.1.0



32
33
34
35
# File 'lib/mongo/error/unchangeable_collection_option.rb', line 32

def initialize(option)
  super("The option #{option} cannot be set on a new collection instance." +
            " The options that can be updated are #{Collection::CHANGEABLE_OPTIONS}")
end