Operational Defect Database

BugZero found this defect 16 days ago.

MongoDB | 2661978

Serialize ObjectId SBE type to key string correctly

Last update date:

5/3/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

Currently, we serialize the ObjectId like so here: case TypeTags::ObjectId: { buf.appendBool(true); buf.appendBytes(getObjectIdView(val), sizeof(ObjectIdType)); break; } There is no equivalent CType when deserializing back to ObjectId and it fails here when converting to bson with "Unknown type". When ObjectId is serialized exactly how bsonObjectId is serialized, it properly converts back into an ObjectId. ObjectId and bsonObjectId are treated as the same in some places. Additionally, when mapping to BSON types, the two both map to BSONType::jstOID. We should serialize ObjectId using appendOID.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...