-
Bug
-
Resolution: Done
-
Major
-
2.5.0.Alpha2
-
None
-
False
-
None
-
False
-
-
Originally discussed at https://debezium.zulipchat.com/#narrow/stream/348106-community-mongodb/topic/JsonSerialization.20getDocumentId.20for.20sharded.20deletes/near/402337403
As per documentation of ChangeStreamDocument#getDocumentKey()
/** * Returns a document containing just the _id of the changed document. * <p> * For unsharded collections this contains a single field, _id, with the * value of the _id of the document updated. For sharded collections, * this will contain all the components of the shard key in order, * followed by the _id if the _id isn’t part of the shard key. * </p> * * @return the document key, or null if the event is not associated with a single document (e.g. a collection rename event) */
The return document will contain all fields used as a sharding key and id field for events from sharded collection. However the code in _JsonSerialization#getDocumentIdChangeStream(BsonDocument document) assumes that only the _id field will be present.
Additionally the separate existence of getDocumentIdChangeStream() and getDocumentIdSnapshot seems to be obsolete a the methods could be merged
- links to
-
RHEA-2024:129636 Red Hat build of Debezium 2.5.4 release