mongify icon indicating copy to clipboard operation
mongify copied to clipboard

Embed only embeds x number of rows in the embedded table

Open tim-phillips opened this issue 8 years ago • 2 comments

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?

tim-phillips avatar Mar 24 '16 02:03 tim-phillips

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.

anlek avatar Mar 26 '16 17:03 anlek

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.

tim-phillips avatar May 18 '16 18:05 tim-phillips