couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: Struggling with erlang
Date Mon, 07 Jan 2013 12:36:20 GMT
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 <Ingemar.Stock@philotech.de> wrote:
>   function(doc){
>                 if(doc.type === "tile"){
>                         return doc.key.length <= 8;
>                 }else{
>                         return true;
>                 }
>         }

Mime
View raw message