MongoCollection.Save() Upserts a random document if it cannot match the ID.

XMLWordPrintableJSON

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

      I have a class:

      public class Foo
      {

      public ObjectId _id

      { get; set; }

      public string Name { get; set; }

      public string Summary

      { get; set; }

      }

      And I have a function for inserting it

      public void EditFoo(Foo fooBar)

      { _db["fooBar"].Save(fooBar, SafeMode.True); }

      If fooBar._id exists in the database the save function does an update. If fooBar.Id does not exist it seems as if the driver is picking a document in the collection. and replacing it with my content.

            Assignee:
            Robert Stam (Inactive)
            Reporter:
            Justin Dearing
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: