CouchDB
  1. CouchDB
  2. COUCHDB-645

_update: document created with undefined _id

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.11
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
    • Environment:

      Linux, CouchDB built from HEAD

    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      Using an update handler, if a document is returned with

      { _id : undefined }

      , the document will be created on the database with an undefined _id and will henceforth not be accessible to modify or delete although it will show up in views.

        Activity

        Hide
        Jim Garvin added a comment - - edited

        Document inserts via _updates handler now get _id when appropriate.

        • If client doesn't provide _id on document insert, then UUID is applied.
        • Location header is added to response so client can have reference to new doc.

        http://github.com/coderifous/couchdb/tree/updates_handler_fix_COUCHDB_645

        Show
        Jim Garvin added a comment - - edited Document inserts via _updates handler now get _id when appropriate. If client doesn't provide _id on document insert, then UUID is applied. Location header is added to response so client can have reference to new doc. http://github.com/coderifous/couchdb/tree/updates_handler_fix_COUCHDB_645
        Hide
        Christian Carter added a comment -

        It might be more appropriate for the new document _id to be that of the UUID that was passed in the request object, so a response can be generated in the update function and still be able to reference the new document path....

        Show
        Christian Carter added a comment - It might be more appropriate for the new document _id to be that of the UUID that was passed in the request object, so a response can be generated in the update function and still be able to reference the new document path....
        Hide
        Alexander Shorin added a comment -

        Fixed in 72ea7e3

        Show
        Alexander Shorin added a comment - Fixed in 72ea7e3

          People

          • Assignee:
            Chris Anderson
            Reporter:
            Cliff Stanford
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development