Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-605

_update handler doesn't conflict for existing document

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 0.10
    • None
    • None
    • None
    • Ubuntu Karmic, in particular it's CouchDB version 0.10.0-0ubuntu3

    • Regular Contributors Level (Easy to Medium)

    Description

      design doc:
      "updates": {
      "hello": "function(doc, req)

      { doc.value = 100500; return [doc, 'foo bar']; }

      "
      }

      $ curl X PUT --data-binary @ http://localhost:5984/shkaf/client:foo << EOF
      >

      {"_id":"client:foo"}

      > EOF

      {"ok":true,"id":"client:foo","rev":"1-967a00dff5e02add41819138abb3284d"}

      $ curl X PUT --data-binary @ http://localhost:5984/shkaf/_design/client/_update/hello/client:foo?A=B << EOF
      >

      {"_id": "client:foo"}

      > EOF
      foo bar

      And it really updated the document.

      What i expected here is error: conflict because document with such _id already existed and i didn't provide _rev to _update handler.

      Attachments

        Activity

          People

            jchris John Christopher Anderson
            temoto Sergey Shepelev
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: