Initialize the Index's name, keySchema and projection properties.
Schema map for the Secondary Index's primary key, in the form of { <partition key name>: { keyType: 'HASH' } }.
Name of the table's secondary index, used to set the IndexName for dynamodb scan and query actions.
Defines how the other attributes for an entity are projected to the index.
Only relevant when type is 'INCLUDE', list of the attributes to project to the secondary index.
Defines what general set of attributes are projected into the secondary index.
The table this index is associated with. Used in queryParams, scanParams, query, and scan.
The type of this secondary index.
Gets the partition key name for the Index.
The name of the primary (or HASH) key.
Add the IndexName to query options.
Options to add IndexName to.
Query options with the IndexName set to the Index.name.
Add the IndexName to scan options.
Options to add IndexName to.
Scan options with the IndexName set to the Index.name.
Gets the sort key name for the Index.
The name of the sort (or RANGE) key, or an empty string if one doesn't exists.
Wrapper around DocumentClient.query method that uses the index and table properties with the key and options params.
Primary key with optional KeyCondition to query the secondary index with.
Used in building the query params.
Promise with the query results, including items fetched.
Creates the params that can be used when calling the DocumentClient.query method.
Primary key with optional KeyCondition to query the secondary index with.
Used in building the query params.
DynamoDB query method params containing the table, index, key and options.
Wrapper around DocumentClient.scan method that uses the index and table properties with the options param.
Used in building the scan params.
Promise with the scan results, including items fetched.
Creates the params that can be used when calling the DocumentClient.scan method.
Used in building the scan params.
DocumentClient scan method's params containing the table, index and options.
Generated using TypeDoc
Represents either Global Secondary Index (GSI) or Local Secondary Index (LSI) for a table. GSI and LSI can be validated using validateIndex or validateIndexes.
If you are using TypeScript you can use Index.createIndex to create an Index with strong typing for the primary key. This provides strong types for the Index.keySchema property, Index.queryParams and Index.scan methods.
examples/Index.ts
See Table for how to include Indexes into a Table.