Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-530

Dublicate Key error while upset

    • Type: Icon: Task Task
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      MongoDB runs on ubuntu server lts 12, development environment is Windows 2008 R2 Ent Server with VS 2010

      When I want to upsert my record I get duplicate key error.
      The Code:
      var update_query = Query.And(
      Query.EQ("Id", item.Id) , ,
      Query.EQ("UserId", item.UserId),
      Query.EQ("Email",item.Email)
      );
      var resxs= coll.Update(update_query,
      Update.Replace(item),
      UpdateFlags.Upsert
      );

      But when I remove "Id" criteria,the code works and doing upset.
      Is there anything I am missing.

      thnx

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            e2burner erhan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: