class BSON::MinKey

Represents a $minKey type, which compares less than any other value in the specification.

@see bsonspec.org/#/specification

@since 2.0.0

Constants

BSON_TYPE

A $minKey is type 0xFF in the BSON spec.

@since 2.0.0

LESSER

Constant for always evaluating lesser in a comparison.

@since 2.0.0

Public Instance Methods

<=>(other) click to toggle source

When comparing a min key with any other object, the min key will always be lesser.

@example Compare with another object.

min_key <=> 1000

@param [ Object ] other The object to compare against.

@return [ Integer ] Always -1.

@since 2.0.0

# File lib/bson/min_key.rb, line 49
def <=>(other)
  LESSER
end
as_json(*args) click to toggle source

Get the min key as JSON hash data.

@example Get the min key as a JSON hash.

min_key.as_json

@return [ Hash ] The min key as a JSON hash.

@since 2.0.0

# File lib/bson/min_key.rb, line 61
def as_json(*args)
  { "$minKey" => 1 }
end