mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

why the _id duplicate?

Open linix01 opened this issue 10 years ago • 3 comments

{ "_id" : ObjectId("579c51d107621eb62ef1f1f2"), "roleId" : "56823", "runePages" : [ { "_id" : ObjectId("57d2cdab383c044802428950"), "usePassiveSkills" : [], "inlayRunes" : [], "name" : "符石页1", "pageId" : 1 }, { "_id" : ObjectId("57d2cdab383c044802428951"), "usePassiveSkills" : [], "inlayRunes" : [], "name" : "符石页2", "pageId" : 2 }, { "_id" : ObjectId("57d2cdab383c044802428950"), "usePassiveSkills" : [], "inlayRunes" : [], "name" : "符石页1", "pageId" : 1 }, { "_id" : ObjectId("57d2cdab383c044802428951"), "usePassiveSkills" : [], "inlayRunes" : [], "name" : "符石页2", "pageId" : 2 } ] }

linix01 avatar Sep 21 '16 14:09 linix01

what's the id generation rules?

linix01 avatar Sep 21 '16 14:09 linix01

From the MongoDB documentation: ObjectId() Returns a new ObjectId value. The 12-byte ObjectId value consists of: - a 4-byte value representing the seconds since the Unix epoch, - a 3-byte machine identifier, - a 2-byte process id, and - a 3-byte counter, starting with a random value.

What's the code that you use to insert the documents?

enrichz avatar Sep 22 '16 08:09 enrichz

How are you generating the ids?

vkarpov15 avatar Sep 25 '16 00:09 vkarpov15