Skip to Main Content

NoSQL Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieve keys by Integer order

ApostolisAug 23 2013 — edited Aug 25 2013

Hello,

let's assume that I have the following major keys:

"10"

"11"

"12"

"1001"

"1011"

"1112"

If I specify a KeyRange with start="10" and end="12" then I will retrieve ALL keys, instead of "10", "11" and "12". As far as I understand, this is because Keys.compareTo() uses the String.compareTo().

So, my question is this. Is it possible to specify that I would like an Integer order and not a String order so, in the above scenario, I can retrieve only the keys: "10", "11" and "12"?

Would it be possible to specify a comparator (such as the Alphanum Comparator http://www.davekoelle.com/files/AlphanumComparator.java) for comparing the keys?

Thank you very much for your help. It is very much appreciated.

Best regards,

Apostolis

This post has been answered by Greybird-Oracle on Aug 24 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2013
Added on Aug 23 2013
8 comments
3,715 views