struct

Mongo::Commands::ListDatabases::Result::Database

Inherits BSON::Serializable / Struct / Value / Object

Constructors

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 methods

from_bson(bson : BSON)

NOTE: See self.new.

Instance methods

empty
Source
empty=(empty : Bool | Nil)
Source
name
Source
name=(name : String)
Source
shards
Source
shards=(shards : BSON | Nil)
Source
size_on_disk
Source
size_on_disk=(size_on_disk : Float64 | Nil)
Source
to_bson(bson = BSON.new)

Converts to a BSON representation.

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