0
我正在使用Mongify將MySQL數據轉換爲MongoDB。然而,我在MySQL表id
字段primary_key
但經過mongify它默認的MongoDB覆蓋_id
值,即"_id" : ObjectId("58369f006ee5c61b9400000e"),
我不想改寫這個我需要的primary_key
完全相同值在MySQL id
列到MongoDB的_id
事情是這樣的:Mongify - MonogoDB _id字段值覆蓋MySQL ID主鍵字段值
MySQL的id: 123
應該轉換成MongoDB的作爲"_id" : ObjectId("123"),
這裏是用戶表的我的翻譯文件
table "users" do
column "id", :key, :as => :integer
column "username", :string
column "password", :string
column "email", :string
column "first_name", :string
column "last_name", :string
column "dob", :date
column "gender", :boolean
column "status", :integer
column "created", :datetime
column "modified", :datetime
end
在此先感謝。