struct Mongo::Commands::IsMaster::Result

Included Modules

Defined in:

cryomongo/commands/replication/is_master.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(bson : BSON) #

Allocate an instance and copies data from a BSON struct.

class User
  include BSON::Serializable
  property name : String
end

data = BSON.new
data["name"] = "John"
User.new(data)

Class Method Detail

def self.from_bson(bson : BSON) #

NOTE See self.new.


Instance Method Detail

def arbiter_only : Bool | Nil #

def arbiter_only=(arbiter_only : Bool | Nil) #

def arbiters : Array(String) | Nil #

def arbiters=(arbiters : Array(String) | Nil) #

def cluster_time : Session::ClusterTime | Nil #

def cluster_time=(cluster_time : Session::ClusterTime | Nil) #

def compression : Array(String) | Nil #

def compression=(compression : Array(String) | Nil) #

def connection_id : Int32 | Nil #

def connection_id=(connection_id : Int32 | Nil) #

def election_id : BSON::ObjectId | Nil #

def election_id=(election_id : BSON::ObjectId | Nil) #

def hidden : Bool | Nil #

def hidden=(hidden : Bool | Nil) #

def hosts : Array(String) | Nil #

Replica sets


def hosts=(hosts : Array(String) | Nil) #

Replica sets


def ismaster : Bool #

def ismaster=(ismaster : Bool) #

def isreplicaset : Bool | Nil #

def isreplicaset=(isreplicaset : Bool | Nil) #

def last_write : BSON | Nil #

def last_write=(last_write : BSON | Nil) #

def local_time : Time | Int64 | Nil #

def local_time=(local_time : Time | Int64 | Nil) #

def logical_session_timeout_minutes : Int32 | Nil #

def logical_session_timeout_minutes=(logical_session_timeout_minutes : Int32 | Nil) #

def max_bson_object_size : Int32 #

def max_bson_object_size=(max_bson_object_size : Int32) #

def max_message_size_bytes : Int32 #

def max_message_size_bytes=(max_message_size_bytes : Int32) #

def max_wire_version : Int32 #

def max_wire_version=(max_wire_version : Int32) #

def max_write_batch_size : Int32 #

def max_write_batch_size=(max_write_batch_size : Int32) #

def me : String | Nil #

def me=(me : String | Nil) #

def min_wire_version : Int32 #

def min_wire_version=(min_wire_version : Int32) #

def msg : String | Nil #

Sharded instances


def msg=(msg : String | Nil) #

Sharded instances


def ok : Float64 #

def ok=(ok : Float64) #

def operation_time : BSON::Timestamp | Nil #

def operation_time=(operation_time : BSON::Timestamp | Nil) #

def passive : Bool | Nil #

def passive=(passive : Bool | Nil) #

def passives : Array(String) | Nil #

def passives=(passives : Array(String) | Nil) #

def primary : String | Nil #

def primary=(primary : String | Nil) #

def read_only : Bool | Nil #

def read_only=(read_only : Bool | Nil) #

def recovery_token : BSON | Nil #

def recovery_token=(recovery_token : BSON | Nil) #

def sasl_supported_mechs : Array(String) | Nil #

def sasl_supported_mechs=(sasl_supported_mechs : Array(String) | Nil) #

def secondary : Bool | Nil #

def secondary=(secondary : Bool | Nil) #

def set_name : String | Nil #

def set_name=(set_name : String | Nil) #

def set_version : Int32 | Nil #

def set_version=(set_version : Int32 | Nil) #

def tags : BSON | Nil #

def tags=(tags : BSON | Nil) #

def to_bson(bson = BSON.new) #

Converts to a BSON representation.

user = User.new name: "John"
bson = user.to_bson