[KAFKA-155] Allow use of dotted notation when for id strategies. Created: 08/Sep/20  Updated: 28/Oct/23  Resolved: 21/Sep/20

Status: Closed
Project: Kafka Connector
Component/s: Sink
Affects Version/s: None
Fix Version/s: 1.3.0

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Case:

 Description   

The current PartialValueStrategy creates full documents which are then used in the ReplaceOneBusinessKeyStrategy. This is fine if the document are an exact match, but if there are extra fields in a document then there won't be a match, which can lead to duplicate key errors.

MongoDB Enterprise > db.test.insert({"a": {"a1": 1}, b: {b1: 1, b2: 1}})
MongoDB Enterprise > db.test.insert({"a": {"a1": 1}, b: {b1: 1, b2: 1, c1: 1}})
 
// Document notation matches one record
MongoDB Enterprise > db.test.find({a: {a1: 1}, b: {b1: 1, b2: 1}})
{ "_id" : ObjectId("5f5740a32d2c3b0aec9e0e49"), "a" : { "a1" : 1 }, "b" : { "b1" : 1, "b2" : 1 } }
 
// Dot notation matches all records.
MongoDB Enterprise > db.test.find({"a.a1": 1, "b.b1": 1, "b.b2": 1})
{ "_id" : ObjectId("5f5740a32d2c3b0aec9e0e49"), "a" : { "a1" : 1 }, "b" : { "b1" : 1, "b2" : 1 } }
{ "_id" : ObjectId("5f5740a92d2c3b0aec9e0e4a"), "a" : { "a1" : 1 }, "b" : { "b1" : 1, "b2" : 1, "c1" : 1 } }



 Comments   
Comment by Githook User [ 21/Sep/20 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix business key update strategies to use dot notation for filters (#39)

KAFKA-155
Branch: master
https://github.com/mongodb/mongo-kafka/commit/57e0cc846340f3eacf0da65c26a9006c76265ede

Comment by Ross Lawley [ 17/Sep/20 ]

PR: https://github.com/mongodb/mongo-kafka/pull/39

Generated at Thu Feb 08 09:05:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.