SnappyDB icon indicating copy to clipboard operation
SnappyDB copied to clipboard

Custom keys sorting and/or findKeyContains()?

Open noties opened this issue 10 years ago • 0 comments

Hi! I've been poking around with your by all means awesome library and found one major issue: All keys are sorted by alphabetical order. OK, it's not that big a deal, if one could find certain key, which "contains" exact id or something. I've googled leveldb and found that it has custom comparators. Is it implemented it your library or it just me who missed that? As an example, one would have temporary list of items which shouldn't be persisted over app relaunches (news app or whatever) with endless scroll. And every time one inserts new data in db it would be messed up in the displaying list. Maybe one could start key with currentTime (with some leading zero, just in case) or create own indexing, but this will be obsolete if by tap one should open details by object's id (which one won't be able to retrieve from db). I understand, that maybe NoSQL solution is not the best for the case I described, but if there is a way, why not?)

noties avatar Jan 19 '15 13:01 noties