6.3. Index Retrieval Operations
The steps to retrieve a referenced value from an index with targetRealm, index and range are as follows.
Let record be the first record in index’s list of records whose key is in range, if any.
If record was not found, return undefined.
Let serialized be record’s referenced value.
Return ! StructuredDeserialize(serialized, targetRealm).
The steps to retrieve multiple referenced values from an index with targetRealm, index, range and optional count are as follows:
If count is not given or is 0 (zero), let count be infinity.
Let records be a list containing the first count records in index’s list of records whose key is in range.
Let list be an empty list.
For each record in records:
Let serialized be record’s referenced value.
Let entry be ! StructuredDeserialize(serialized, targetRealm).
Append entry to list.
Return list converted to a sequence
.
The values of an record in an index are the keys of records in the referenced object store.
The steps to retrieve a value from an index with index and range are as follows.
Let record be the first record in index’s list of records whose key is in range, if any.
If record was not found, return undefined.
Return the of running the steps to convert a key to a value with record’s value.
The steps to retrieve multiple values from an index with index, range and optional count are as follows:
If count is not given or is 0 (zero), let count be infinity.
Let records be a list containing the first count records in index’s list of records whose key is in range.
Let list be an empty list.
For each record in records:
Let entry be the result of running the steps to convert a key to a value with record’s value.
Append entry to list.
Return list converted to a sequence
.