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

Dublicate Key error while upset

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • MongoDB runs on ubuntu server lts 12, development environment is Windows 2008 R2 Ent Server with VS 2010

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: