def to_bson_key(validating_keys = Config.validating_keys?)
      if validating_keys
        raise BSON::String::IllegalKey.new(self) if BSON::String::ILLEGAL_KEY =~ self
      end
      self
    end
def to_bson_key(validating_keys = Config.validating_keys?)
      if validating_keys
        raise BSON::String::IllegalKey.new(self) if BSON::String::ILLEGAL_KEY =~ self
      end
      self
    end
Get the symbol as a BSON key name encoded C symbol.

 @example Get the symbol as a key name.
   :test.to_bson_key

 @return [ String ] The encoded symbol as a BSON key.

 @see http://bsonspec.org/#/specification

 @since 2.0.0