couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Smith <...@couch.io>
Subject Re: Auto-UUID generation in _update [PATCH]
Date Sat, 12 Jun 2010 16:18:53 GMT
On Sat, Jun 12, 2010 at 23:13, Paul Bonser <misterpib@gmail.com> wrote:

> > Why not have these three cases:
> >
> >  * Document update: doc is something, req.id == doc._id
> >  * Document create, PUT to _update/some_id: doc is null, req.id is
> "some_id"
> >  * Document create, POST to _update, doc is null, req.is is a random
> uuid
> >
> > The update function can decide whether or not to honor the "suggested"
> doc
> > id but at least it is now capable of matching the JSON API.
>
> Ah yes, making it a bit closer to the way that a regular PUT vs. POST
> works. What if someone POSTs an ID as part of the _update request?
> Return an error telling them that they can only include a doc ID as
> part of a PUT?
>

Well, my objective is that it is *possible* for _update to match the JSON
API.

Users can POST to _update/some_id with a JSON whose _id doesn't match. A
well-written update function would presumably return an error (or whatever
straight couch does).


> >
> > --
> > Jason Smith
> > Couchio Hosting
> >
>
>
>
> --
> Paul Bonser
> http://probablyprogramming.com
>



-- 
Jason Smith
Couchio Hosting

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message