Closed stoyanmkd closed 7 years ago
@stoyanmkd you can use the before_save
method to save the original id (which would be under row.pre_mongify_id).
Check out the doc regarding before save.
Basically, you're looking at doing something like this:
table "device", :embed_in => 'user', :on => 'idUser' do
column "idDevice", :key, :as => :integer
column "Identifier", :string
column "applicationID", :string
column "idUser", :integer, :references => "user"
before_save do |row, user_row|
row.original_id = row.pre_mongify_id
end
end
It's my translation file.
I would like to embed "device" table in "user" table, but still to keep the reference from "device" to "message". When I process this translation file, the key for the 'device' disappears in the converted Mongo database. Any idea how to fix it?
Best Regards, Stoyan