background image
C H A P T E R 1 1
Data Storage and Retrieval
Using Newton Data Storage Objects
internationalized index: cursor methods such as
return entries in
the internationally-indexed order.
Queries on Descending Indexes
Even though queries and cursors based on descending order indexes work just like
normal queries and cursors, their behavior can seem confusing if you forget that it
is a function of index order. It is always helpful to remember the following points
when working with queries and cursors--especially when using descending indexes:
The "beginning" and "end" of a range of index values is a function of index
key order.
The cursor navigates entries in index key order.
This section provides examples of the behavior of cursors that use descending
indexes. These examples are based on a soup containing the entries shown in the
following code fragment; although this example uses string values, any kind of
index key value may be sorted in descending order.
{data: "able", ...};
{data: "axe", ...};
{data: "name", ...};
{data: "noun", ...};
Soup indexes normally sort string data in ascending alphabetical order; for example,
. A descending index sorts the same data in
reverse alphabetical order; for example,
Figure 11-6 depicts the reversed ordering that a descending index provides, with
examples of cursor behavior that is a function of index ordering.
Figure 11-6
Cursor operations on descending index
Descending key order
Valid subrange
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна