I would leave the convenience function... Let users specify or let users get
wildcarded.
-Alexander
On Jun 8, 2010, at 5:10 PM, francisco treacy wrote:
> You're totally right. I was confused... so then this is not a bug.
>
> Btw - in my riak-js code I have:
>
> Riak.prototype.makeLinks = function(links) {
> var i = this.defaults.interface;
> return links.map(function(link) {
> link.tag = link.tag || "_";
> return '</' + i + '/' + link.bucket + '/' + link.key + '>;
> riaktag="' + link.tag + '"';
> }).join(", ");
> }
>
> From a Riak point of view, do you think it would be better to remove
> the " link.tag = link.tag || "_"; " bit, and let it explode if the
> user doesn't provide a tag?
>
> F
>
>
> 2010/6/8 Sean Cribbs <[email protected]>:
>> Creating tags and using the wildcard when doing a link-walking query are two
>> different operations. There is no default tag.
>>
>> Sean Cribbs <[email protected]>
>> Developer Advocate
>> Basho Technologies, Inc.
>> http://basho.com/
>>
>> On Jun 8, 2010, at 4:58 PM, francisco treacy wrote:
>>
>>> IIRC Riak requires a tag and otherwise client libraries just provide
>>> "_" (right?)
>>>
>>> So probably @robject.to_link should return a "_" in the tag field by
>>> default - instead of nil.
>>>
>>> I'm sorry i have 0 time to provide a patch :(
>>>
>>> Francisco
>>>
>>> 2010/6/8 Sean Cribbs <[email protected]>:
>>>> Francisco,
>>>>
>>>> Thanks for that, I'll either make it be required or raise an exception.
>>>> The Ruby API should better guide you down the golden path - tags are
>>>> required on the Riak side, so they should on the Ruby side.
>>>>
>>>> Sean Cribbs <[email protected]>
>>>> Developer Advocate
>>>> Basho Technologies, Inc.
>>>> http://basho.com/
>>>>
>>>> On Jun 8, 2010, at 4:48 PM, francisco treacy wrote:
>>>>
>>>>> The following code yields an exception
>>>>>
>>>>> item = client['items']['item']
>>>>> catalog = client['catalogs']['test']
>>>>> link = item.to_link
>>>>> catalog.links << link
>>>>> catalog.store
>>>>>
>>>>> (...)
>>>>> /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/client/curb_backend.rb:63:in
>>>>> `perform': Expected [200, 204, 300] from Riak but received 400.
>>>>> Invalid Link header. Links must be of the form (Riak::FailedRequest)
>>>>> </riak/BUCKET/KEY>; riaktag="TAG"
>>>>> from
>>>>> /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/client/http_backend.rb:92:in
>>>>> `put'
>>>>> from
>>>>> /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/robject.rb:122:in
>>>>> `store'
>>>>>
>>>>> This is because a 'tag' is not set, but tags shouldn't be required.
>>>>>
>>>>> (Consider setting link.tag = "something" before line 4, and it will
>>>>> work correctly).
>>>>>
>>>>> Francisco
>>>>>
>>>>> _______________________________________________
>>>>> 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
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com