Reputation: 2963
I have an mongodb based application which use 12 byte objectid as primary key and as user id, and I have another Django app using Mysql, and need to inherits the user id generated from mongodb (inherit means not create new id but just store id which come from mongodb, and use it as a foreign key anywhere possible).
What's the best solution of,
Thanks.
Upvotes: 4
Views: 4641
Reputation: 6281
I have been using both BINARY(12)
and VARCHAR(24)
to store MongoDB's ObjectIds in MySQL. BINARY(12)
uses less disk space, but you need to use HEX()
to work with it as a string.
Upvotes: 9