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

Update function adds document with undefined ID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.2
    • None
    • None
    • Mac OS X 10.8.2
      Python 2.7.2

    Description

      I'm using update function _design/app/_update/test, here is the body of this function:

      function(doc, req)

      { return [req.form, '<p>Hello World</p>']; }

      Using the HTML5 form below I submit a new object to this update function:

      <form id="form" method="POST" action="_update/test">
      <input type="hidden" name="type" value="payment">
      <input type="hidden" name="version" value="4">
      Date: <input type="date" name="date"><br/>
      Note: <input type="text" name="note"><br/>
      <input type="submit" value="save"><br/>
      </form>

      As a result I expect to get either error (id is not specified) or new document with generated ID (same as in POST request http://wiki.apache.org/couchdb/HTTP_Document_API#POST)

      In fact new document is created with NULL ID. I can see it in Futon, but can not modify. The only way to get rid of this document is to drop whole the database.

      Attachments

        Activity

          People

            Unassigned Unassigned
            antonio7 Anthony Ananich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: