Discussion:
About Sort
(too old to reply)
gibeon
2007-07-16 02:09:49 UTC
Permalink
Hi all,

I built a secondary index with a custom sort function. It works well
(I can traverse the index by the sort order). However, I wonder how to
traverse the index by a reverse order.

Is it possible?

Thanks.
Don Anderson
2007-07-17 01:12:28 UTC
Permalink
Post by gibeon
Hi all,
I built a secondary index with a custom sort function. It works well
(I can traverse the index by the sort order). However, I wonder how to
traverse the index by a reverse order.
Is it possible?
Thanks.
Sure. If you are using the C or C++ API, then you
are already using DB->cursor() to get a cursor and iterate using
the DB_NEXT flag. (right?) To go in reverse, you use DB_PREV
instead of DB_NEXT.

Don't be tempted to change the custom sort function.

- Don

Loading...