You can add a binary secondary index on the object which has the timestamp
in it in the format that you've shown above. Then you can do a range query
on that value. You can then query for this objects directly via 2i or you
can pass them into a map/reduce job using 2i as the inputs.

Cheers.
OJ



On Thu, May 9, 2013 at 2:45 PM, Sivaraman Vi <[email protected]> wrote:

>
> Hello All,
>
> I am trying to implement the following functionality in Riak. I have a
> bucket where I am storing objects. One of the JSON field in the object is
> timestamp. Now I want to retrieve the objects whose timestamp is between an
> interval like (20130605 08:00:00 to 20130605 08:05:00) I mean i need to get
> all the objects from 8.00 to 8.05.
> Can I implement this using Map Reduce or using secondary indexes?
>
> Another approach I am considering is that the bucket itself would be
> created like 20130605:0800:0805 and then store the objects under this
> bucket. So now, I dont want to implement conditional time interval based
> queries. Please suggest a way.
>
> Regards,
> Sivaraman
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 

OJ Reeves
+61 431 952 586
http://buffered.io/
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to