0

I'm replacing a session manager from Django/MySQL to Go/Riak. I need to periodically check for expired sessions and delete them.

Any one knows how to delete a register using Riak's javascript/MapReduce using ?

joaonrb
  • 965
  • 11
  • 30

1 Answers1

0

You could, in theory, initialize the internal erlang client with {ok,C}=riak:local_connect(), even inside a map or reduce phase, and then do C:delete(<<"Bucket">>,<<"Key">>). or whatever it is you need.

Joe
  • 25,000
  • 3
  • 22
  • 44
  • First, thank you for the reply. I found multiple solutions using Erlang and a more or less good documentation in this technology. I wanted to avoid Erlang since I don't know the language and my routine is fairly complicated. Lacking something better I can map in Javascript and reduce using Erlang. But still, if you know any good documentation on MapReduce Riak using Javascript I really appreciate it. – joaonrb Mar 17 '15 at 09:42
  • if I try this but couldn't delete elements for special types. I search for documentation but I found only the source in repo. Do you know how to do it or where this documentation? – joaonrb Mar 17 '15 at 14:19
  • No, need. I mimic [this](http://docs.basho.com/riak/latest/dev/advanced/bucket-types/#Buckets-as-Namespaces) example and it works. Instead of `C:delete(<<"Bucket">>,<<"Key">>).` I use `C:delete({<<"maps">>, <<"Bucket">>}, <<"Key">>).`. – joaonrb Mar 17 '15 at 14:31