That is what I was thinking. But denormalizing the subject field would mean when I update the subject field the data stuff won't be updated. Is there a solution for that? Or should I handle that with the application code?
On Tue, Jun 4, 2013 at 8:49 PM, Alexander Sicular <sicul...@gmail.com> wrote: > You don't. Riak is not a relational system. As you've noted, you should > demoralize your data. > > > @siculars > http://siculars.posthaven.com > > Sent from my iRotaryPhone > > On Jun 4, 2013, at 20:43, Kartik Thakore <thakore.kar...@gmail.com> wrote: > >> Hi, >> >> I have spent the last couple hours trying to understand how to store >> and/or search relationships between buckets of information. Currently, >> I have two buckets (will have more with more relationships) 'subjects' >> and 'data'. In subjects I store data such as: >> >> http://.../riak/subjects/001 has { "name" : "First Last", "age_int": 25 }, >> http://.../riak/subjects/002 has { "name" : "First Last", "age_int": 55 } >> >> so on. >> >> and in 'data' I have : >> >> { "subject" : "001", "complication": [0, 1] }, >> { "subject" : "002", "complication": [1] } >> >> >> Now my question is how do I query information like: >> >> Where Subject has age_int between 20 to 100 & complication includes 1? >> >> I thought I could accomplish this with map reduce, but I can access >> only one bucket at a time. Is there a different way I should be >> storing data like this? Or should I denormalize the subject into >> 'data'? >> >> Regards, >> Kartik >> >> _______________________________________________ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com