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 0E143E765 for ; Mon, 7 Jan 2013 12:36:25 +0000 (UTC) Received: (qmail 54113 invoked by uid 500); 7 Jan 2013 12:36:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 53923 invoked by uid 500); 7 Jan 2013 12:36:23 -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 53894 invoked by uid 99); 7 Jan 2013 12:36:22 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 12:36:22 +0000 Received: from localhost (HELO mail-vb0-f46.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 12:36:22 +0000 Received: by mail-vb0-f46.google.com with SMTP id b13so18855673vby.19 for ; Mon, 07 Jan 2013 04:36:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.27.244 with SMTP id w20mr73838337vdg.44.1357562181091; Mon, 07 Jan 2013 04:36:21 -0800 (PST) Received: by 10.52.68.209 with HTTP; Mon, 7 Jan 2013 04:36:20 -0800 (PST) In-Reply-To: References: Date: Mon, 7 Jan 2013 12:36:20 +0000 Message-ID: Subject: Re: Struggling with erlang From: Robert Newson To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Something like; fun({Props}) -> couch_util:get_value(<<"type">>, Props) == <<"tile">> andalso couch_util:get_value(<<"key">>, Props) /= undefined andalso byte_size(couch_util:get_value(<<"key">>, Props)) =< 8 end. On 7 January 2013 12:12, Stock, Ingemar wrote: > function(doc){ > if(doc.type === "tile"){ > return doc.key.length <= 8; > }else{ > return true; > } > }