anlek / mongify

Mongify allows you to map your data from a sql database and into a mongodb document database.
http://github.com/anlek/mongify
MIT License
317 stars 82 forks source link

Nested embed not working #135

Closed jaganreddy closed 7 years ago

jaganreddy commented 7 years ago

Here is my translation.rb

table "images" do
    column "id", :key, :as => :integer
    column "image_id", :integer
    column "updatedAt", :datetime
end

table "copies" , :embed_in => :images, :as => :object, :on => :image_id do
    column "id", :key, :as => :integer
    column "test", :string
    column "image_id", :integer, :references => "images"
end

table "files" , :embed_in => copies, :as => :object, :on => :copies_id do

    column "name", :string
    column "size", :string
    column "type", :string
    column "key", :string
    column "updatedAt", :string
    column "createdAt", :string
    column "copies_id", :integer, :references => "copies"
end

files are not creating inside copies.

Am I missing anything in the code. Please help me

Regards, Jagan

anlek commented 7 years ago

Mongify (at the moment) doesn't support second level embedding (embedding item inside an item).

Sorry