Next: , Previous: BTree Cursor API, Up: User API Reference


5.7 Index Cursors

Index cursors are made the same way standard cursors are, with a call to make-cursor, except with the index as the argument instead of a standard btree. In addition to the standard cursor operations, which provide the direct key and value of a btree-index, the following class of “p” cursors work on an index and allow you to get the primary value of the indexed-btree that the btree-index belongs to.

They each return multiple values (exists? key primary-value primary-key).

— Generic Function: elephant:cursor-pcurrent cursor

Returns has-tuple / secondary key / value / primary key at the current position.

— Generic Function: elephant:cursor-pfirst cursor

Moves the key to the beginning of the secondary index. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-plast cursor

Moves the key to the end of the secondary index. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pnext cursor

Advances the cursor. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pprev cursor

Moves the cursor back. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pset cursor key

Moves the cursor to a particular key. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pset-range cursor key

Move the cursor to the first key-value pair with key greater or equal to the key argument, according to the lisp sorter. Returns has-pair secondary key value primary key.

— Generic Function: elephant:cursor-pget-both cursor key value

Moves the cursor to a particular secondary key / primary key pair. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pget-both-range cursor key value

Moves the cursor to a the first secondary key / primary key pair, with secondary key equal to the key argument, and primary key greater or equal to the pkey argument. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-next-nodup cursor

Move to the next non-duplicate element (with different key.) Returns has-pair key value.

— Generic Function: elephant:cursor-next-dup cursor

Move to the next duplicate element (with the same key.) Returns has-pair key value.

— Generic Function: elephant:cursor-pnext-nodup cursor

Move to the next non-duplicate element (with different key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pnext-dup cursor

Move to the next duplicate element (with the same key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-prev-nodup cursor

Move to the previous non-duplicate element (with different key.) Returns has-pair key value.

— Generic Function: elephant:cursor-prev-dup cursor

Move to the previous duplicate element (with the same key.) Returns has-pair key value.

— Generic Function: elephant:cursor-pprev-nodup cursor

Move to the previous non-duplicate element (with different key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pprev-dup cursor

Move to the previous duplicate element (with the same key.) Returns has-tuple / secondary key / value / primary key.