couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <>
Subject Re: inserting a single document
Date Mon, 07 Jul 2008 22:34:07 GMT

On Jul 8, 2008, at 00:06, Michael Hendricks wrote:

> Is there any reason to insert single documents into CouchDB by  
> PUTing or
> POSTing the document to the DB URL instead of using the _bulk_docs
> interface?  If I've understood the source correctly, it looks as  
> thoough
> single inserts are handled internally by CouchDB in exactly the same  
> way
> as doing a bulk insert with a single document.
> While updating some Perl bindings for CouchDB, I noticed that  
> specially
> handling single inserts requires unnecessary, duplicated code.  If
> there's no compelling reason, I'll just reimplement single inserts in
> terms of bulk insert.

We strive for buzzword compliance and the buzzword in question
is REST :-)

Consider a client that is not interested in bulk insertion that only  
and wants GET/PUT/POST/DELETE to a single resource. That's where
the singe document PUT/POST API makes sense.

 From your library's point of view, only using the bulk API is totally
acceptable, though.


View raw message