This issue can't be edited
Because it belongs to an archived project. Jira admins can restore projects from the archive.
Add support for ObjectId in MongoDB
Description
Environment
None
Activity
Show:
Gunnar Morling September 30, 2014 at 9:51 AM
FTR, object ids are exposed now through String
and ObjectId
. Numeric types didn't really seem useful.
Emmanuel Bernard June 4, 2014 at 7:57 AM
Long won't be enough, ObjectId is 12 bytes => 96 bits. You would need BigInteger.
Emmanuel Bernard June 4, 2014 at 7:41 AM
Explore the ability to retrieve the ObjectId at creation time as an IdentityGenerator.
Fixed
Details
Details
Assignee
Gunnar Morling
Gunnar MorlingReporter
Gunnar Morling
Gunnar MorlingParticipants
Emmanuel Bernard
Gunnar Morling
Components
Fix versions
Priority
Created May 21, 2014 at 3:49 PM
Updated September 30, 2014 at 9:51 AM
Resolved September 30, 2014 at 9:50 AM
MongoDB by default uses a 12-byte BSON type with a special structure as document ids:
{ "_id" : ObjectId("537cc8f50fe960c16c350237"), "name" : "foo" }
This id is assigned during insert by the driver and comprises parts for timestamp, machine etc. We should support this as a) it is the "natural" way to represent ids in MongoDB and b) in order to facilitate integration with other applications relying on document ids being object ids.
It should be possible to represent such id in entities as
String
,ObjectId
and probablyLong
BigInteger
.