tidwall / buntdb

BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support
MIT License
4.57k stars 289 forks source link

Question: Search by index with equal comparison #26

Closed snovichkov closed 7 years ago

snovichkov commented 7 years ago

Is it somehow possible to search by index with equal comparison (by value)? Do You planed to create a custom method for that?

Thanks!

tidwall commented 7 years ago

Hi Sergey,

In order to do an equal comparison by value, you'll need to execute an AscendGreaterOrEqual and then do a comparison on each item from inside the iterator.

Example code: https://github.com/tidwall/buntdb/issues/18#issuecomment-281130798

Perhaps it's possible to add something like an AscendEqual method which wraps around the method above.

snovichkov commented 7 years ago

Thanks!