Allow use of dotted notation when for id strategies.

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.3.0
    • Affects Version/s: None
    • Component/s: Sink
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 } }
      

            Assignee:
            Ross Lawley
            Reporter:
            Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: