From user-return-19853-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sun Feb 19 01:34:45 2012 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 9CEA99733 for ; Sun, 19 Feb 2012 01:34:45 +0000 (UTC) Received: (qmail 17847 invoked by uid 500); 19 Feb 2012 01:34:44 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17816 invoked by uid 500); 19 Feb 2012 01:34:44 -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 17799 invoked by uid 99); 19 Feb 2012 01:34:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 01:34:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of john.tigernassau@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-tul01m020-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 01:34:36 +0000 Received: by obbuo19 with SMTP id uo19so7665195obb.11 for ; Sat, 18 Feb 2012 17:34:15 -0800 (PST) Received-SPF: pass (google.com: domain of john.tigernassau@gmail.com designates 10.182.12.74 as permitted sender) client-ip=10.182.12.74; Authentication-Results: mr.google.com; spf=pass (google.com: domain of john.tigernassau@gmail.com designates 10.182.12.74 as permitted sender) smtp.mail=john.tigernassau@gmail.com; dkim=pass header.i=john.tigernassau@gmail.com Received: from mr.google.com ([10.182.12.74]) by 10.182.12.74 with SMTP id w10mr9155129obb.51.1329615255664 (num_hops = 1); Sat, 18 Feb 2012 17:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=2A6oPQlciP8Ey3t7EHuGtwWCFJ5Fm8aaFicuK/ALodk=; b=AJuvy5Z6T9nVlzLugVyGFvH2pIiB9zCLUZLBkeC/YRqM9Jd2X+KQO3iFxVlkR5NeX2 2XekjTplnJefpz2C7Tl/2z+UP600Tn4sKvIBjT7+i1h12FgDIawA+F107TqP98tc3cho X48WwBxi+0ris0JG5FCNkG5hjOtVE5/Ti5pfY= Received: by 10.182.12.74 with SMTP id w10mr7777810obb.51.1329615255618; Sat, 18 Feb 2012 17:34:15 -0800 (PST) Received: from [172.16.112.79] ([206.54.113.250]) by mx.google.com with ESMTPS id 1sm2827144obo.2.2012.02.18.17.34.10 (version=SSLv3 cipher=OTHER); Sat, 18 Feb 2012 17:34:13 -0800 (PST) Message-ID: <4F40518B.4040403@gmail.com> Date: Sat, 18 Feb 2012 18:34:03 -0700 From: "john.tiger" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: PUT json data References: <4F3DBCB4.8030900@gmail.com> <4F3DF092.4080506@gmail.com> <4F3E9340.1090009@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 02/18/2012 02:59 AM, Robert Newson wrote: > See http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API and > 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 >>>> 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. >>>> >>>> >>>> -- >>>> ,,,^..^,,, >>