mongify
mongify copied to clipboard
Embed only embeds x number of rows in the embedded table
Let's say I have 1000 records in table A and 20 records in table B. When I embed table B into table A, Mongify only embeds the first 20 records in table A even though table A has reference IDs on every record.
table "asset_model", :rename_to => "models" do
column "asset_model_id", :key
column "short_description", :string, :rename_to => "name"
column "category_id", :integer, :rename_to => "categoryId", :references => :categories
column "manufacturer_id", :integer, :rename_to => "manufacturerId", :references => :manufacturers
column "asset_model_code", :string, :rename_to => "modelNumber"
column "long_description", :text, :rename_to => "description"
column "created_by", :integer, :rename_to => "createdBy"
column "creation_date", :timestamp, :rename_to => "createdAt"
column "modified_by", :integer, :rename_to => "updatedBy"
column "modified_date", :timestamp, :rename_to => "updatedAt"
end
table "category", :embed_in => :models, :on => "category_id", :as => :object do
before_save do |category_row, models_row, unset_models_row|
category_row._id = models_row.delete('categoryId')
end
column "short_description", :rename_to => "name"
end
How would I embed matching records from table B into every record in table A?
I think this would be a bug, but I'm currently unable to hunt it down. Please feel free to do a PR and I can review it.
I just left it normalized.
On a semi-related note, I've been creating views on the SQL side which is proving to be very useful. This way I'm presenting the data to mongify in a form closer to how I want it to end up.