Save fails with duplicate key exception when updating an existing document and _id is a string internally represented as an ObjectId in the database

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      To reproduce use this class:

      public class C

      { [BsonRepresentation(BsonType.ObjectId)] public string Id; public int X; }

      and these statements:

      var doc = new C

      { X = 1 }

      ;
      collection.Save(doc);

      doc.X = 2;
      collection.Save(doc);

              Assignee:
              Robert Stam
              Reporter:
              Robert Stam
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: