link order

Toby Hede tobyhede at info-architects.net
Sun Jul 10 01:27:19 EDT 2011


Hello,

Long-time linker, first-time poster, etc

Just trying to confirm that links are stored as an array and therefore
the order of the links is preserved.

I am using riak.js and coffeescript

In this case a "column" has several "cards"

    column = {title: "development"}
    meta = { links: [{bucket: "cards", key: "1", tag: "card"},
{bucket: "cards", key: "2", tag: "card"}] }
    riak.save(COLUMN, null, column, meta, (err, data, meta) ->)


Links are stored (according to rekon) as:
    [{"tag":"card","target":"/riak/cards/1"},{"tag":"card","target":"/riak/cards/2"},{"tag":"rel=up","target":"/riak/columns"}]

When I walk the links:
    riak.walk(COLUMN, key, [["_", "card"]], (err, data, meta) ->

It certainly seems to preserve the ordering from the array, but is
this something I can rely on?

Cheers,
Toby


Regards,
Toby Hede
--------------------------------------------------------
email: tobyhede at info-architects.net
twitter: @tobyhede
skype: tobyhede
linkedin: http://www.linkedin.com/in/tobyhede
plus: https://plus.google.com/u/0/100415561779631856102
--------------------------------------------------------
--------------------------------------------------------




More information about the riak-users mailing list