Class Mongo::Server::Description::Features
In: lib/mongo/server/description/features.rb
Parent: Object

Defines behavior around what features a specific server supports.

@since 2.0.0

Methods

Constants

MAPPINGS = { :transactions => 7, :scram_sha_256 => 7, :array_filters => 6, :op_msg => 6, :sessions => 6, :collation => 5, :max_staleness => 5, :find_command => 4, :list_collections => 3, :list_indexes => 3, :scram_sha_1 => 3, :write_command => 2, :users_info => 2   List of features and the wire protocol version they appear in.

Wire protocol versions map to server releases as follows:

  • 2 => 2.6
  • 3 => 3.0
  • 4 => 3.2
  • 5 => 3.4
  • 6 => 3.6
  • 7 => 4.0
  • 8 => 4.2

@since 2.0.0

SERVER_TOO_OLD = "Server at (%s) reports wire version (%s), but this version of the Ruby driver " + "requires at least (%s)."   Error message if the server is too old for this version of the driver.

@since 2.5.0

DRIVER_TOO_OLD = "Server at (%s) requires wire version (%s), but this version of the Ruby driver " + "only supports up to (%s)."   Error message if the driver is too old for the version of the server.

@since 2.5.0

DRIVER_WIRE_VERSIONS = (2..8).freeze   The wire protocol versions that this version of the driver supports.

@since 2.0.0

Attributes

server_wire_versions  [R]  @return [ Range ] server_wire_versions The server‘s supported wire
  versions.

Public Class methods

Initialize the features.

@example Initialize the features.

  Features.new(0..3)

@param [ Range ] server_wire_versions The server supported wire

  versions.

@since 2.0.0

Public Instance methods

Check that there is an overlap between the driver supported wire

  version range and the server wire version range.

@example Verify the wire version overlap.

  features.check_driver_support!

@raise [ Error::UnsupportedFeatures ] If the wire version range is

  not covered by the driver.

@since 2.5.1

[Validate]