struct DynFork::Migration::ModelState
- DynFork::Migration::ModelState
- Struct
- Value
- Object
Overview
To control the state of Models in the super collection.
Included Modules
- BSON::Serializable
Defined in:
dynfork/migration.crConstructors
- .new(collection_name : String, field_name_and_type_list : Hash(String, String), data_dynamic_fields : Hash(String, String), model_exists : Bool = false)
-
.new(bson : BSON)
Allocate an instance and copies data from a BSON struct.
Class Method Summary
-
.from_bson(bson : BSON)
NOTE See
self.new
.
Instance Method Summary
- #collection_name : String
- #data_dynamic_fields : Hash(String, String)
- #data_dynamic_fields=(data_dynamic_fields : Hash(String, String))
- #field_name_and_type_list : Hash(String, String)
- #field_name_and_type_list=(field_name_and_type_list : Hash(String, String))
- #model_exists=(model_exists : Bool)
- #model_exists? : Bool
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
Constructor Detail
def self.new(collection_name : String, field_name_and_type_list : Hash(String, String), data_dynamic_fields : Hash(String, String), model_exists : Bool = false)
#
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
Instance Method Detail
def to_bson(bson = BSON.new)
#
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson