Exception: BSON::Error::IllegalKey

Inherits:
BSON::Error
  • Object
show all
Defined in:
lib/bson/error/illegal_key.rb

Overview

Raised when validating keys and a key is illegal in MongoDB

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ IllegalKey

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Instantiate the exception.

Examples:

Instantiate the exception.

BSON::Error::IllegalKey.new(string)

Parameters:

  • string (String)

    The illegal string.



18
19
20
# File 'lib/bson/error/illegal_key.rb', line 18

def initialize(string)
  super("'#{string}' is an illegal key in MongoDB. Keys may not start with '$' or contain a '.'.")
end