SnappyDB icon indicating copy to clipboard operation
SnappyDB copied to clipboard

Problems with Range Search: FROM and TO not exists, no record founded

Open CeccoCQ opened this issue 9 years ago • 1 comments

Hi, I have a lot of records entered into the database, where each of them has key with ISO8601 string.

I have to query before a certain date and between two dates passed as ISO8601 string. In my case, the FROM and TO keys not exists. I receive no records from the query.

There are some rules that I don't know?

CeccoCQ avatar Jun 21 '15 07:06 CeccoCQ

Hi @CeccoCQ the search uses lexicographical order you should at least provide a FROM that contains the starting string date. since the keys are sorted in LevelDB it will bring all keys after FROM until it encounter a key which doesn't start with FROM (or it reaches a valid TO key).

see the doc for more examples https://github.com/nhachicha/SnappyDB#keys-search

Cheers

nhachicha avatar Jun 22 '15 10:06 nhachicha