Type of the indexed record.
IndexedStore constructor.
Construction options.
When IndexedStoreOptions.indexes is given, will create them.
Get names of indexed properties.
Get number of records present in the storage.
Get a view of all records from storage.
Array of all records. Array can be modified by client, as it is created on each method call.
Iterate over records from storage.
Removes all records from storage and leaves it empty.
Notice that indexes are not removed, only their associated records are deleted.
Check whether indexName
contains records indexed with indexValue
.
Name of the index.
Value of that index.
Check whether index with indexName
exists.
Name of the index.
Create new indexes for a set of record properties.
When storage already contains records, they will be indexed for newly defined indexes.
Name of properties that need to be indexed.
Remove index from storage.
Notice that records are not removed, and can be found by another existing indexes.
Name of the index.
Whether index was removed or not.
Remove all indexes, except the primary one.
Filter a set of documents.
When index related params are not specified, will apply predicate
over all records.
Predicate function.
Index from were documents need to be retrieved.
Value of that index.
List of filtered records.
Find a single record from storage.
When index related params are not specified, will apply predicate
over all records.
Predicate function.
Index from were documents need to be retrieved.
Value of that index.
Record matching search criteria, if found.
Get number of records stored under indexName
.
Name of the index.
Inserts records into storage.
After insertion is completed, will index records by properties that are indexable.
List of documents to be inserted.
Map a set of records.
When index related params are not specified, will map all of the records.
Mapping function.
Index from were documents need to be retrieved.
Value of that index.
List of mapped records.
Read documents under indexName
having it's value equal to indexValue
.
Reference to internal index structure is returned, and therefore the caller should not alter it.
Name of the index.
Value of that index.
List of documents having indexName
equal to indexValue
.
Reindex document after it's indexName
property has been changed.
This method will also set the new value of indexName
to record.
Caller needs to call this method everytime value for one of the indexed properties changes.
Notice that primary key should remain immutable, it's change is forbidden.
Name of the index.
Old value of the index. It is used for record retrieval.
The updated value of the index. Used for actual reindexing.
Predicate that matches record, indexed property of which has been changed.
Remove from storage record that match search criteria.
Search criteria is expressed as name of the index, it's value, and an optional predicate for filtering records from that index.
Notice that only the first record that matched the predicate will be removed.
Name of the index.
Value of that index.
Predicate used for record filtering.
When indexName
is the primary one, this parameter is optional.
Removed document, if found.
IndexedStore represents a storage of records that are indexed over multiple properties.
Records ar stored in a multilevel map, with the following structure:
Indexed properties are allowed to be nullable (i.e. have
null
orundefined
as their values).This is a low-level class and exposes raw primitives. It needs to be used by higher level abstractions.