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 5419FC82C for ; Thu, 27 Jun 2013 14:51:35 +0000 (UTC) Received: (qmail 40762 invoked by uid 500); 27 Jun 2013 14:51:33 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 40694 invoked by uid 500); 27 Jun 2013 14:51:33 -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 40685 invoked by uid 99); 27 Jun 2013 14:51:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 14:51:32 +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 kxepal@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 14:51:28 +0000 Received: by mail-wi0-f179.google.com with SMTP id hj3so719126wib.0 for ; Thu, 27 Jun 2013 07:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=WB9i++2kG3h6o1ImhQ5/SZscYeBzWnVezfTZPLlu9EY=; b=0NpZD9NJxIxIRpcDbyLtV46Oug74J4A+TpqXj8EEFtCk8pqQrdPRU+AElzYsQt89sd 5talH5K8Mg3+bNxPOJ0+LniDuGeSIVMJC2duxVuBIiXVXa46DClhOCq++n9WE5EDePb8 EAHocH2sqfgK/506vjVjczNcL6oLFnFQAuQg4kuhVgn+ocILLjIPZ1Mt/b6xEBLsYT1f 3shep/vC1wGuT2KqlIrzIp4TXsfUbm80dBNIrZqOUu9W2rakvhYdmt04mZcE3Iu9mQNS uCCjOLniQNDVPofogAyjQ2bKb1eVoX8qbEpAmjM3zwIPlSItjK47LkEev+2PpfSblxPo aDZA== MIME-Version: 1.0 X-Received: by 10.194.178.138 with SMTP id cy10mr6471048wjc.61.1372344667271; Thu, 27 Jun 2013 07:51:07 -0700 (PDT) Received: by 10.180.125.137 with HTTP; Thu, 27 Jun 2013 07:51:07 -0700 (PDT) In-Reply-To: <2122761033.41746.1372343884015.JavaMail.root@tpip.net> References: <2122761033.41746.1372343884015.JavaMail.root@tpip.net> Date: Thu, 27 Jun 2013 18:51:07 +0400 Message-ID: Subject: Re: {case_clause,{error,[],function_clause}} in CouchDb-1.2.0 From: Alexander Shorin To: "user@couchdb.apache.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Alexander, Does curl request to this view with same query parameters works? -- ,,,^..^,,, On Thu, Jun 27, 2013 at 6:38 PM, Alexander Kuleshov wr= ote: > Hello, > > I'm trying to use Couchdb-1.2.0 with Couchbeam. > > I create database, documents and etc... > > I have a view: > > { > "_id": "_design/task", > "_rev": "1-0ba3c64c158deb66749cf23aaee9e855", > "language": "erlang", > "views": { > "by_task_creation": { > "map": "fun({Doc}) ->\n\tcase couch_util:get_value(<<\"_id\">>= , Doc, null) of\n\t TaskId =3D <<\"task:\", _/binary>> ->\n\t\tcase couc= h_util:get_value(<<\"created\">>, Doc, null) of\n\t\t null -> ok;\n\t\t = Created -> Emit(Created, null)\n\t\tend;\n\t _ -> ok\n\tend\nend.\n", > "reduce": "fun(_Keys, Values, false) -> length(Values);\n (_= Keys, Values, true) -> lists:sum(Values) end.\n" > }, > "by_task_selector": { > "map": "fun({Doc}) ->\n\tcase couch_util:get_value(<<\"_id\">>= , Doc, null) of\n\t TaskId =3D <<\"task:\", _/binary>> ->\n\t\tcase couc= h_util:get_value(<<\"selector\">>, Doc, null) of\n\t\t null -> ok;\n\t\t= Selector -> Emit(Selector, TaskId)\n\t\tend;\n\t _ -> ok\n\tend\nend= .\n" > } > } > } > > But when i'm trying to fetch it i got error: > > {case_clause,{error,[],function_clause}} > > I'm trying with: couchbeam_view:fetch(DB, {<<"_design/task">>, <<"by_task= _creation">>}, [{reduce, true}]) > > How can i make it correctly? > > Thank you.