Exception: BSON::String::IllegalKey

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/bson/string.rb

Overview

Raised when validating keys and a key is illegal in MongoDB

Since:

  • 4.1.0

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ IllegalKey

Instantiate the exception.

Examples:

Instantiate the exception.

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

Parameters:

  • string (String)

    The illegal string.

Since:

  • 4.1.0



116
117
118
# File 'lib/bson/string.rb', line 116

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