Closed kamrankhatti closed 7 years ago
Found the workaround which was already there in Mongify docs I missed that out :) just need to add
before_save do |row|
row._id = row.delete('pre_mongified_id')
end
This before_save
event does not allow Mongify to overwrite MySQL id
values.
Thanks anyways.
great, it works for me.
Hello -
I ran mongify script to migrate MySQL data into MonogDB which works fine. However, I have
id
field in MySQL tables asprimary_key
but after mongify it overwrites with default mongify_id
i.e"_id" : ObjectId("58369f006ee5c61b9400000e"),
I don't want to overwrite this I need exactly same value ofprimary_key
inid
column in MySQL inot MongoDB_id
something look like this:MySQL
id: 123
should convert into MongoDb as"_id" : ObjectId("123"),
Any help?