My application utilizes SQL Server and MongoDB. In order to link records / documents from both sides, I'm thinking to use SQL's BigInt
value (Int64
in C#) in place of MongoDB's _id. This BigInt
value is generated from a SQL Server Identity
column. I thought it's perfect.
However, in this thread Is it bad to change _id type in MongoDB to integer?
someone mentioned MongoDB has to check its uniqueness before inserting it. So is it true MongoDB doesn't check uniqueness if ObjectId.GenerateNewId()
is used otherwise does?