With upserts key can be in query or mod

XMLWordPrintableJSON

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

      These will work correctly:
      upsert({_id:FOO},

      {key:BAR, other:1}

      )
      upsert({_id:FOO, key:BAR}, {$set: {other: 1}})
      upsert({_id:FOO, key:BAR},

      {other:1}

      ) // converted to the first example.

      This must fail:
      upsert({_id:FOO, key:BAR},

      {key:BAZ}

      )

      This can cause dup IDs but wont fail until/unless we get unique indexes working across shards:
      upsert({_id:FOO, key:BAR}, {$set: {other:1}})
      upsert({_id:FOO, key:BAZ}, {$set: {other:1}})

              Assignee:
              Mathias Stearn
              Reporter:
              Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: