Index object

Index object in persistent storage.


- integer, length of an index, number of objects associated represented by the index. Read-only property.
- boolean, direction of access of objects from the index. Write-only property.
- value, element of the DbIndex at the key position. Read/Write accessor by key. key has to be of the same type as the type of Index object.
If the index was created as non unique then the return value of [] accessor is either undefined or an array - list of items under the key.
- keys, keys of first and last element of the range. Returns slice of DbIndex which contains elements from start key and up to end key.
begin is a low boundary of key value (if null then there is no low boundary).
end is a high boundary of key value (if null then there is no high boundary).



( key, val [, replace: true|false ] ) : true|false

Inserts val object into Index and associates it with key value. Optionally replaces it with existing object if it exists.

( key [,obj] ) returns: true | false

Method removes object obj by key from the index. Method returns true on success, otherwise false.
If Index is unique, obj is optional.


( min-key, max-key [, ascent [, start-inclusive [, end-inclusive]]] ) returns: selection object.

Returns selection in the Index based on criteria min-key, max-key, ascent or descent order, start-inclusive, end-inclusive. Default values:

var sel =, maxVal, true);
for( var obj in sel ) { ... }

( ) : undefined

Removes all items from the index object.