Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E51B0200CCB for ; Thu, 20 Jul 2017 15:34:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E393C16B54C; Thu, 20 Jul 2017 13:34:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 33C9416B549 for ; Thu, 20 Jul 2017 15:34:51 +0200 (CEST) Received: (qmail 4156 invoked by uid 500); 20 Jul 2017 13:34:50 -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 4144 invoked by uid 99); 20 Jul 2017 13:34:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2017 13:34:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 506081805A2 for ; Thu, 20 Jul 2017 13:34:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.38 X-Spam-Level: ** X-Spam-Status: No, score=2.38 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JgCkK8jLnP6M for ; Thu, 20 Jul 2017 13:34:47 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BBF9B5F522 for ; Thu, 20 Jul 2017 13:34:46 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id 191so26721421oii.2 for ; Thu, 20 Jul 2017 06:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=54W/p71fhWRR70UVwCzMFJ14rDyldHfHjwvxQtaEGhE=; b=awnPwFRumVPI1WqQPI1TwUUszsztsUn+Onxk5ApOx8lagPVF1B36n3YZjkUAe3rPfh wIN8rdZczaqH3TfqD+j5CQJmadB/aqs/z9GrpLrrqhykllxCTg71h8DsSfBU65pBa7bj /doxo73kh6ImyE5ZA78Y9KebA6xIpIsVGlWFAHJ26QdvEhMBouBG66lc+BStGXVcm+dR h1hC/HZX26B9buLDpXsvMjea+s5X3liqmCjR7snXSm26IjK3JJmJkUxvGmQpxe+q9ntN tL8fpdLM3AXG9QJiu3WChLtAqo8FGxMQgP2UF0orQ9SE5RHx5pEkh5mBvupCI8Ghr/vv o7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=54W/p71fhWRR70UVwCzMFJ14rDyldHfHjwvxQtaEGhE=; b=AclpSytRUeBjy9rBdGZL2LaigXehiRsqMWjXJPfXfgf6K85S+9uBQPWJ7kmCD3DY10 EdC02bcF7FgBQPn5K6O1PORhONmNW7+3o6HTXu/WKCFTcRe1fAdFa2soKOQvXGxQJag9 ukXYu8eCsGSpd/VLfF/hkKTEN6zi6IVJwcV2LIQDFiSdhLDV0ekKVEpNNclTiVEEcOaV c51M1vEQQA0ZIrKal64wjWP0AOOctqMMtOaiLSTQtAL5sy+r2APbJYoCJC1py+5kGF10 ocdXHDs8B+aJU2kPxFJ7yyh+gdyYVLsX7VsIDfCY/Pfc1md6idh86Ii0d51zH0P6sbNh gs6g== X-Gm-Message-State: AIVw110hEnqRUrqqfgmpdkT6DzM6ZsIrVs19T1qZC0qIlNJ1v0ypDnLA CNLw2WG+TRyk7W5QWsqowfoFGYNZNg== X-Received: by 10.202.245.7 with SMTP id t7mr5511852oih.49.1500557685220; Thu, 20 Jul 2017 06:34:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.77.161 with HTTP; Thu, 20 Jul 2017 06:34:44 -0700 (PDT) In-Reply-To: References: From: John Le Brasseur Date: Thu, 20 Jul 2017 15:34:44 +0200 Message-ID: Subject: Re: CouchDB 2.0.0: '{"error":"invalid_design_doc","reason":"`views.reduce` field must have object type"} To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary="001a113d2550caed110554bfcf7a" archived-at: Thu, 20 Jul 2017 13:34:52 -0000 --001a113d2550caed110554bfcf7a Content-Type: text/plain; charset="UTF-8" Thanks Scott. I thought it was something else completely. Interestingly CouchDB v 2.0.0 rejected the curl command immediately but v 1.6.1 did not complain. However, upon opening Futon(1.6.1), the view was completely unusable, as one would expect. Credit to those who upgraded CouchDB to 2.0.0 On 19 July 2017 at 17:51, Scott Shattuck wrote: > It looks to me like there's an extra '}' after the map function string and > before the reduce function string value. This would seem to be consistent > with the "views.reduce" message which implies the reduce isn't part of the > test: {} object but instead is one level too high. > > > ss > > > On Wed, Jul 19, 2017 at 9:30 AM, John Le Brasseur < > johnlebrasseur@gmail.com> > wrote: > > > Hi > > The command below works for CouchDB 1.6.1 but not for 2.0.0. > > I saw it mentioned on the Cloudant website but couldn't see an > explanation. > > Could someone give me the reason or solution please: > > > > curl -X PUT http://user:pwd@127.0.0.1:5984/database/_design/abc > > -d'{"views":{"test":{"map":"function(doc){\n > > emit(doc.key,doc.value);\n}"},"reduce":"function(key,values){\n return > > count(values)\n;}"}, "language": "javascript"}' -H > > "Content-Type:application/json" > > > > reply: > > {"error":"invalid_design_doc","reason":"`views.reduce` field must have > > object type"} > > > > Many thanks. > > > > John. > > > Thanks again. John --001a113d2550caed110554bfcf7a--