Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A3ED987F for ; Sun, 19 Feb 2012 01:46:37 +0000 (UTC) Received: (qmail 44008 invoked by uid 500); 19 Feb 2012 01:46:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 43974 invoked by uid 500); 19 Feb 2012 01:46:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 43966 invoked by uid 99); 19 Feb 2012 01:46:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 01:46:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ziggythehamster@gmail.com designates 74.125.82.54 as permitted sender) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 01:46:28 +0000 Received: by wgbdq12 with SMTP id dq12so3412178wgb.23 for ; Sat, 18 Feb 2012 17:46:06 -0800 (PST) Received-SPF: pass (google.com: domain of ziggythehamster@gmail.com designates 10.180.8.226 as permitted sender) client-ip=10.180.8.226; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ziggythehamster@gmail.com designates 10.180.8.226 as permitted sender) smtp.mail=ziggythehamster@gmail.com; dkim=pass header.i=ziggythehamster@gmail.com Received: from mr.google.com ([10.180.8.226]) by 10.180.8.226 with SMTP id u2mr7004474wia.16.1329615966885 (num_hops = 1); Sat, 18 Feb 2012 17:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=RWE5svdVFm6X/JaBLCOxM4oxZ0reBGOBt5JgTE9LLiw=; b=fIMYCmtUWSw/RiPiFM7EINXKUwdfbEUFRu4a7ZIo0Z7QABeq4z5P/ngkd6qQAzAFsS GGEqKzT3cGz5BMeB6EZiL1YsAzc9rvslMrwp0jT5zAIPzHXltBHvRLIg7c/pefPbsE35 NIKDu3Rg/hIXajtStAE7a2eITi9prbCAS5dY4= MIME-Version: 1.0 Received: by 10.180.8.226 with SMTP id u2mr5878404wia.16.1329615966776; Sat, 18 Feb 2012 17:46:06 -0800 (PST) Sender: ziggythehamster@gmail.com Received: by 10.223.118.131 with HTTP; Sat, 18 Feb 2012 17:46:06 -0800 (PST) Received: by 10.223.118.131 with HTTP; Sat, 18 Feb 2012 17:46:06 -0800 (PST) In-Reply-To: <4F40518B.4040403@gmail.com> References: <4F3DBCB4.8030900@gmail.com> <4F3DF092.4080506@gmail.com> <4F3E9340.1090009@gmail.com> <4F40518B.4040403@gmail.com> Date: Sat, 18 Feb 2012 19:46:06 -0600 X-Google-Sender-Auth: n2OMmHsGVc8QSZ_lrj1BxHhzHY4 Message-ID: Subject: Re: PUT json data From: Keith Gable To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d04428be8632c0d04b9475734 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04428be8632c0d04b9475734 Content-Type: text/plain; charset=ISO-8859-1 The docs are crystal clear to me, and I don't use the bulk docs API. Though I do admit that the docs do assume you know how to use cURL, and if you don't, then I can see where they wouldn't be very helpful. I have noticed that there are a lot of people that attempt to use CouchDB without a background in REST APIs... that's basically the only type of API you do as a Rails programmer, which is another reason why the CouchDB API is easy for me to follow. CouchDB also requires you to forget about everything you know about relational databases and SQL. Think more about sorting and labelling sheets of paper. On Feb 18, 2012 7:34 PM, "john.tiger" wrote: > On 02/18/2012 02:59 AM, Robert Newson wrote: > >> See http://wiki.apache.org/**couchdb/HTTP_Bulk_Document_APIand >> particularly http://wiki.apache.org/**couchdb/HTTP_Bulk_Document_** >> API#Modify_Multiple_Documents_**With_a_Single_Request >> . >> > yes, I can read. While the docs might be clear to you they are not clear > to myself and others (based on questions I found searching). Are you > refusing contributions for clearer documentation ? That kind of attitude > is really stupid. > > > > > > > B. >> >> On 17 February 2012 17:49, john.tiger> >> wrote: >> >>> 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 wrote: >>>> >>>>> On Fri, Feb 17, 2012 at 10:15 AM, john.tiger>>>> 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. >>>>> >>>>> >>>>> -- >>>>> ,,,^..^,,, >>>>> >>>> >>> > --f46d04428be8632c0d04b9475734--