couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "john.tiger" <john.tigernas...@gmail.com>
Subject Re: PUT json data
Date Fri, 17 Feb 2012 17:49:52 GMT
On 02/17/2012 03:49 AM, Robert Newson wrote:
> an "array of json objects" posted to /dbname is not valid input for
> the CouchDB API.
>
> As others have noted, you can POST a single json object to /dbname, or
> PUT a single json object to /dbname/docname, or POST multiple
> documents to /dbname/_bulk_docs using the {"docs":[]} format.
>
> http://wiki.apache.org/couchdb/HTTP_Document_API

okay, I see that _bulk_docs actually does not keep the extra "docs":[] 
layer but loads each record individually.

I do think this should still be changed since if extracting a big json 
data set - it is a pain to append the {"docs":

Also the wiki is not that clear - how can I submit a brief description 
of this to the wiki page ?  any password or process required ?





>
> B.
>
> On 17 February 2012 07:35, Alexander Shorin<kxepal@gmail.com>  wrote:
>> On Fri, Feb 17, 2012 at 10:15 AM, john.tiger<john.tigernassau@gmail.com>  wrote:
>>> On 02/16/2012 08:00 PM, Alexander Shorin wrote:
>>>> I suppose that you'd like to create multiple documents at one. Than
>>>> you have to use bulk api:
>>>>
>>>> http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Modify_Multiple_Documents_With_a_Single_Request
>>>
>>> yes but the _bulk_docs docs say must have  {"docs": [.....]} - this seems
>>> wrong - if an array of json objects is correct json syntax, then couchdb
>>> should be able to import it.
>>>
>> JSON array might be valid from syntax point, but it is invalid from
>> point of expected data for /db/_bulk_docs resource.
>>
>>
>> --
>> ,,,^..^,,,


Mime
View raw message