Hi Sean,

Thanks for your quick response. If I follow the steps from Sam, it works as
expected. I tried the same steps but with my own bucket (and data) and it
worked too. The difference between what I was trying and what Sam did was
because I used JavaScript and Sam Erlang.

Is there any trick to use Javascript?


[]'s


[image: Ideais Tecnologia]
*João Machado*joao.mach...@ideais.com.brTel.: 55 21 3553 1301 R: 215Cel.:
55 21 8124 3531Site: www.ideais.com.br


On Fri, Aug 2, 2013 at 5:09 PM, Sean Cribbs <s...@basho.com> wrote:

> Hi João,
>
> You might want to try the steps shown in Sam Elliott's "cookbook":
> https://github.com/basho/riak_crdt_cookbook/blob/master/counters/README.md
>
>
> On Fri, Aug 2, 2013 at 2:56 PM, João Machado 
> <joao.mach...@ideais.com.br>wrote:
>
>> Hello,
>>
>> Anyone tried to use MR with counters?
>>
>> I'm trying with the following steps:
>>
>> Increment the counter:
>> -> curl -X POST http://localhost:8098/buckets/BUCKET/counters/MY_COUNTER-d 1
>>
>> Confirm the actual value:
>> -> curl http://localhost:8098/buckets/BUCKET/counters/MY_COUNTER
>> *1*
>>
>> Execute mapreduce:
>> -> curl   -X POST -H "content-type: application/json"
>> http://127.0.0.1:8098/mapred -d @map_red.js
>> *{"error":"bad_utf8_character_code"}
>> *
>>
>> Where the map_red.js is:
>>
>> {
>>   "inputs":"BUCKET",
>>   "query":[
>>        {"map":{"language":"javascript","name":"Riak.mapValues"}}
>>        ,{"reduce":{"language":"javascript","name":"Riak.reduceSum"}}
>>
>> ]
>> }
>>
>>
>>
>>
>>
>> []'s
>>
>>
>> [image: Ideais Tecnologia]
>> *João Machado*joao.mach...@ideais.com.brTel.: 55 21 3553 1301 R: 215Cel.:
>> 55 21 8124 3531Site: www.ideais.com.br
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs <s...@basho.com>
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to