@veterancrowd/aws-service-search
v0.6.32
Published
AWS service search utilities.
Downloads
75
Readme
aws-service-search
AWS service search utilities.
API Documentation
Functions
dehydratePageKeys(entityManager, entityToken, indexTokens, shardKeyTokens, pageKeys, [logger]) ⇒ string
Dehydrate a shard-keyed map of page keys into a compressed string. Supports multiple paged queries on different indexes. In this case, present indexTokens, shardKeyTokens, and pageKeys as arrays of the same length. If all pageKeys entries are empty objects, returns an empty string.
Kind: global function
Returns: string - Dehydrated page keys.
| Param | Type | Description | | --- | --- | --- | | entityManager | EntityManager | EntityManager instance. | | entityToken | string | Entity token. | | indexTokens | Array.<string> | Index token or array of key tokens. May be an array of same, of the same length as pageKeys. | | shardKeyTokens | string | Array.<string> | Shard key token. May be an array of same, of the same length as pageKeys. | | pageKeys | object | Array.<object> | Rehydrated page keys. May be an array of same. | | [logger] | object | Logger (defaults to console). |
rehydratePageKeys(entityManager, entityToken, indexToken, shardKeyToken, pageKeys, [logger]) ⇒ string
Rehydrate a single shardKeyToken's shard-keyed map of page keys from a dehydrated map, possibly representing multiple shardKeyTokens.
Kind: global function
Returns: string - Rehydrated page keys.
| Param | Type | Description | | --- | --- | --- | | entityManager | EntityManager | EntityManager instance. | | entityToken | string | Entity token. | | indexToken | string | Index token or array of key tokens. | | shardKeyToken | string | Shard key token. | | pageKeys | object | Dehydrated page keys. | | [logger] | object | Logger (defaults to console). |
addFilterCondition(options) ⇒ undefined
Add filter condition to DynamoDB query objects.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.attributeName | string | The name of the attribute to filter on. | | options.attributeValue | string | The beginning value of the attribute to filter on. | | options.expressionAttributeNames | object | The expression attribute names object to add the attribute name to. | | options.expressionAttributeValues | object | The expression attribute values object to add the attribute value to. | | options.filterConditions | Array.<string> | The filter conditions array to add the filter condition to. | | [options.negate] | boolean | Whether to negate the filter condition. | | options.operator | string | The operator to use for the filter condition. |
addFilterConditionExists(options) ⇒ undefined
Add exists filter condition to DynamoDB query objects.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.attributeName | string | Array.<string> | The name of the attribute to filter on. | | [options.exists] | boolean | Array.<boolean> | The value indicating whether the attribute should exist or not. | | options.expressionAttributeNames | object | The expression attribute names object to add the attribute name to. | | options.filterConditions | Array.<string> | The filter conditions array to add the filter condition to. | | [options.operator] | 'AND' | 'OR' | The operator to use for the filter condition. |
addFilterConditionRange(options) ⇒ undefined
Add range filter condition to DynamoDB query objects.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.attributeName | string | The name of the attribute to filter on. | | [options.attributeValueFrom] | string | The beginning value of the attribute to filter on. | | [options.attributeValueTo] | string | The ending value of the attribute to filter on. | | options.expressionAttributeNames | object | The expression attribute names object to add the attribute name to. | | options.expressionAttributeValues | object | The expression attribute values object to add the attribute value to. | | options.filterConditions | Array.<string> | The filter conditions array to add the filter condition to. | | [options.negate] | boolean | Whether to negate the filter condition. |
getShardQuery(options) ⇒ function
Get a shard query function for use with Entity Manager query function.
Kind: global function
Returns: function - The shard query function.
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.dbClient | WrappedDynamoDbClient | The Wrapped DynamoDB client. | | [options.expressionAttributeNames] | object | The expression attribute names object. | | [options.expressionAttributeValues] | object | The expression attribute values object. | | [options.filterConditions] | Array.<string> | The filter conditions array. | | [options.indexName] | string | The name of the index to query. | | options.partitionKeyName | string | The name of the partition key. | | [options.scanIndexForward] | boolean | Whether to scan the index forward. | | [options.sortKeyCondition] | string | The sort key condition. |
getSortKeyCondition(options) ⇒ string | undefined
Get a sort key condition for a DynamoDB query & update query objects.
Kind: global function
Returns: string | undefined - The sort key condition.
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.entityManager | EntityManager | The entity manager. | | options.entityToken | string | The entity token. | | options.expressionAttributeNames | object | The expression attribute names object to add the attribute name to. | | options.expressionAttributeValues | object | The expression attribute values object to add the attribute value to. | | options.item | object | An item containing enough data to generate the partial sort key. | | options.operator | string | The sort key operator. | | options.sortKeyName | string | The name of the sort key. |
getSortKeyConditionRange(options) ⇒ string | undefined
Get a range sort key condition for a DynamoDB query & update query objects.
Kind: global function
Returns: string | undefined - The sort key condition.
| Param | Type | Description | | --- | --- | --- | | options | object | config object | | options.entityManager | EntityManager | The entity manager. | | options.entityToken | string | The entity token. | | options.expressionAttributeNames | object | The expression attribute names object to add the attribute name to. | | options.expressionAttributeValues | object | The expression attribute values object to add the attribute value to. | | options.itemFrom | object | An item containing enough data to generate the 'from' sort key. | | options.itemTo | object | An item containing enough data to generate the 'to' sort key. | | options.sortKeyName | string | The name of the sort key. |
parseBooleanQueryParam(param, token) ⇒ boolean | undefined
Parse a string query parameter into a boolean value.
Kind: global function
Returns: boolean | undefined - The parsed boolean value.
| Param | Type | Description | | --- | --- | --- | | param | string | The query parameter to parse. | | token | string | The name of the query parameter. |
parseDelimitedQueryParam(param, token, [enumeration], [delimiter]) ⇒ Array.<string>
Parse a delimited string query parameter into an array, optionally against an enumeration.
Kind: global function
Returns: Array.<string> - The parsed string array.
| Param | Type | Description | | --- | --- | --- | | param | string | The query parameter to parse. | | token | string | The name of the query parameter. | | [enumeration] | object | The enumeration to parse against. | | [delimiter] | string | The delimiter to split the string on. |
parseNumberQueryParam(param, token) ⇒ number | undefined
Parse a string query parameter into a number value.
Kind: global function
Returns: number | undefined - The parsed number value.
| Param | Type | Description | | --- | --- | --- | | param | string | The query parameter to parse. | | token | string | The name of the query parameter. |
parseWholeNumberQueryParam(param, token) ⇒ number | undefined
Parse a string query parameter into a whole number value. 'all' returns Infinity.
Kind: global function
Returns: number | undefined - The parsed whole number value.
| Param | Type | Description | | --- | --- | --- | | param | string | The query parameter to parse. | | token | string | The name of the query parameter. |
See more great templates and other tools on my GitHub Profile!