struct Wakdata::RestAPI::CryoMongo::VersionData

Included Modules

Defined in:

wakdata/rest-api/cryomongo.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(data_name : String, versions : Array(String) = Array(String).new, _id : BSON::ObjectId = BSON::ObjectId.new, creation_date : Time = Time.utc) #

[View source]
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)

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Class Method Detail

def self.from_bson(bson : BSON) #

NOTE See self.new.


[View source]

Instance Method Detail

def _id : BSON::ObjectId #

def clone #

[View source]
def copy_with(data_name _data_name = @data_name, versions _versions = @versions, _id __id = @_id, creation_date _creation_date = @creation_date) #

[View source]
def creation_date : Time #

def data_name : String #

def to_bson(bson = BSON.new) #

Converts to a BSON representation.

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

[View source]
def versions : Array(String) #