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
在此先感谢。