Hi all,
I have two buckets 'users' and 'projects'. A user object can have a link to a 
project object with tag name "owns". And there can be many such links with a 
given user object. I try to walk the "owns" link from a user object with the 
following syntax:
(I am using riak.js and coffeescript, but I guess the syntax is straightforward 
:-))

@db_client.walk 'users', user_key, [["_", 'owns', 1]], (error, linked_data) =>

Technically, the link walking seems to be working fine. It returns an object 
with two entries: 
1- entry "0" with an array of keys
2 - entry "1" with an array of objects. 

However, the order of the objects and the keys does not match. Between several 
iterations I can see the order changing. This later fails the logic of my 
program since I use the key to fetch more information about a project and 
display it at a later stage in the program. 

My question is, is there something I am doing wrong in the syntax of my link 
walking? Is this the normal way riak is implemented? (i.e. a loose coupling 
between keys and objects during link walking)? What's the best way fix this? 
Ignore the objects, stick with the keys and go fetch the actual objects from 
the projects bucket? That doesn't sound efficient to me though.
Any thought?
José

PS: As I said, I am using Riak.js in a Node.js project with coffeescript


_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to