DynFork::Migration::ModelState
For control state of Model in the super collection.
Constructors
new(collection_name : String, field_name_and_type_list : Hash(String, String), data_dynamic_fields : Hash(String, String), model_exists : Bool = false)
Sourcenew(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
Instance methods
collection_name
Sourcedata_dynamic_fields
Sourcefield_name_and_type_list
Sourcemodel_exists?
Sourceto_bson(bson = BSON.new)
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson