couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: Native List Functions with CouchDB
Date Tue, 08 Feb 2011 14:51:11 GMT
Oleg,

Sorry, I haven't tried Erlang list/show functions yet, so perhaps
someone else could be more helpful...

However, there is an example in the JavaScript test suite:
https://github.com/apache/couchdb/blob/trunk/share/www/script/test/erlang_views.js#L67

That's typically the first place you should look when trying out
under-documented features in CouchDB. (^_^)


Good luck!

Zach

On Tue, Feb 8, 2011 at 1:19 AM, Oleg Krevosheev <oleg@imcmilk.com.ua> wrote:
> Here's how I did.
> {
>    "_id": "_design / test",
>    "_rev": "1931-98f79c92675e9541e448a62377dcc067 ",
>    "language": "erlang",
>    "views": {
>        "vtest": {
>            "map": "fun ({Doc}) -> \ n Key = proplists: get_value (<<\"
key \
> ">>, Doc, null), \ n Val = proplists: get_value (<<\" val \ ">>, Doc,
null),
> \ n Emit (Key, Val) \ n end."
>        }
>    }
>    "lists": {
>        "ltest": "fun (Head, {Req}) -> Send (<<\" Test \ ">>) end."
>    }
> }
> View works fine. Makes a request
> http://192.168.2.47:5984/proxy_02_2011/_design/test/_list/ltest/vtest
> nothing shows up
>

Mime
View raw message