1. The configuration for Ripple goes like this...
require 'ripple'
Ripple.client.host = 'hostname-or-ip-address'
2. You could write
x = Klass.find(key)
if x.nil?
x = Klass.new
x.save
end
Unless you meant that you need an atomic read-or-create operation. I don't
know if such a thing is possible in Ripple or Riak. Locking semantics is
really not part of the nosql "paradigm", if I understand it right.
3. Have a class save its instances in different buckets? Polymorphic types
doesn't sound like it would be possible in Ripple.
Regards,
~Tom
On Tue, Jun 21, 2011 at 9:28 AM, Pablo Chacin <[email protected]> wrote:
> Hello
>
> I'm new to reply and Ruby in general, so probably my questions have evident
> answers.
> I'm trying to use the Document Model, but there are a few things that are
> not clear from
> the documentation:
> 1. How to configure ripple when used in a ruby (not rails) application.
> 2. I want to do something similar to the get_or_new method provided by the
> Bucket (get an existing document or create a new one, it it doesn't exists)
> 3. control the bucket on which the document is stored/retrieve (using an
> attribute). From what I've seen, riak uses the class name as bucket.
>
> Thanks in advance
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com