API Reference
Resources
DynamodbTable
A cloud Dynamodb table.
Initializers
bring ex;
new ex.DynamodbTable(props: DynamodbTableProps);
Name | Type | Description |
---|---|---|
props | DynamodbTableProps | No description. |
props
Required
- Type: DynamodbTableProps
Methods
Inflight Methods
Name | Description |
---|---|
deleteItem | Delete an item from the table. |
getItem | Get an item from the table. |
putItem | Put an item into the table. |
query | Return all items with a given partition key value. |
scan | Return one or more items and item attributes by accessing every item in a table or a secondary index. |
transactWriteItems | Perform a synchronous write operation that groups up to 100 action requests. |
updateItem | Get an item from the table. |
deleteItem
inflight deleteItem(key: Json): void
Delete an item from the table.
key
Required
- Type: Json
key of the item.
getItem
inflight getItem(key: Json): Json
Get an item from the table.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html
key
Required
- Type: Json
key of the item.
putItem
inflight putItem(item: Json, props?: DynamodbTablePutItemProps): void
Put an item into the table.
item
Required
- Type: Json
data to be inserted.
props
Optional
dynamodb PutItem props.
query
inflight query(props: DynamodbTableQueryProps): DynamodbTableQueryResult
Return all items with a given partition key value.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
props
Required
- Type: DynamodbTableQueryProps
properties for the query operation.
scan
inflight scan(props?: DynamodbTableScanProps): DynamodbTableScanResult
Return one or more items and item attributes by accessing every item in a table or a secondary index.
props
Optional
- Type: DynamodbTableScanProps
properties for the scan operation.
transactWriteItems
inflight transactWriteItems(props: DynamodbTransactWriteItemsProps): void
Perform a synchronous write operation that groups up to 100 action requests.
props
Required
properties for the transact write items operation.
updateItem
inflight updateItem(key: Json, props?: DynamodbTableUpdateItemProps): Json
Get an item from the table.
key
Required
- Type: Json
key of the item.
props
Optional
dynamodb UpdateItem props.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
name | str | Table name. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
name
Required
name: str;
- Type: str
Table name.
Redis
A cloud redis db.
Initializers
bring ex;
new ex.Redis();
Name | Type | Description |
---|
Methods
Inflight Methods
Name | Description |
---|---|
del | Removes the specified key. |
get | Get value at given key. |
hget | Returns the value associated with field in the hash stored at key. |
hset | Sets the specified field to respective value in the hash stored at key. |
rawClient | Get raw redis client (currently IoRedis). |
sadd | Add the specified members to the set stored at key. |
set | Set key value pair. |
smembers | Returns all the members of the set value stored at key. |
url | Get url of redis server. |
del
inflight del(key: str): num
Removes the specified key.
key
Required
- Type: str
the key.
get
inflight get(key: str): str
Get value at given key.
key
Required
- Type: str
the key to get.
hget
inflight hget(key: str, field: str): str
Returns the value associated with field in the hash stored at key.
key
Required
- Type: str
the key.
field
Required
- Type: str
the field at given key.
hset
inflight hset(key: str, field: str, value: str): num
Sets the specified field to respective value in the hash stored at key.
key
Required
- Type: str
key to set.
field
Required
- Type: str
field in key to set.
value
Required
- Type: str
value to set at field in key.
rawClient
inflight rawClient(): any
Get raw redis client (currently IoRedis).
sadd
inflight sadd(key: str, value: str): num
Add the specified members to the set stored at key.
key
Required
- Type: str
the key.
value
Required
- Type: str
the value to add to the set at given key.
set
inflight set(key: str, value: str): void
Set key value pair.
key
Required
- Type: str
the key to set.
value
Required
- Type: str
the value to store at given key.
smembers
inflight smembers(key: str): MutArray<str>
Returns all the members of the set value stored at key.
key
Required
- Type: str
the key.
url
inflight url(): str
Get url of redis server.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
Table
A NoSQL database table that can be used to store and query data.
Initializers
bring ex;
new ex.Table(props: TableProps);
Name | Type | Description |
---|---|---|
props | TableProps | No description. |
props
Required
- Type: TableProps
Methods
Preflight Methods
Name | Description |
---|---|
addRow | Add a row to the table that is created when the app is deployed. |
Inflight Methods
Name | Description |
---|---|
delete | Delete a row from the table, by primary key. |
get | Get a row from the table, by primary key. |
insert | Insert a row into the table. |
list | List all rows in the table. |
tryGet | Get a row from the table if exists, by primary key. |
update | Update a row in the table. |
upsert | Insert a row into the table if it doesn't exist, otherwise update it. |
addRow
addRow(key: str, row: Json): void
Add a row to the table that is created when the app is deployed.
key
Required
- Type: str
row
Required
- Type: Json
delete
inflight delete(key: str): void
Delete a row from the table, by primary key.
key
Required
- Type: str
primary key to delete the row.
get
inflight get(key: str): Json
Get a row from the table, by primary key.
key
Required
- Type: str
primary key to search.
insert
inflight insert(key: str, row: Json): void
Insert a row into the table.
key
Required
- Type: str
primary key to insert the row.
row
Required
- Type: Json
data to be inserted.
list
inflight list(): MutArray<Json>
List all rows in the table.
tryGet
inflight tryGet(key: str): Json
Get a row from the table if exists, by primary key.
key
Required
- Type: str
primary key to search.
update
inflight update(key: str, row: Json): void
Update a row in the table.
key
Required
- Type: str
primary key to update the row.
row
Required
- Type: Json
data to be updated.
upsert
inflight upsert(key: str, row: Json): void
Insert a row into the table if it doesn't exist, otherwise update it.
key
Required
- Type: str
primary key to upsert the row.
row
Required
- Type: Json
data to be upserted.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
columns | MutMap<ColumnType> | Table columns. |
name | str | Table name. |
primaryKey | str | Table primary key name. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
columns
Required
columns: MutMap<ColumnType>;
- Type: MutMap<ColumnType>
Table columns.
name
Required
name: str;
- Type: str
Table name.
primaryKey
Required
primaryKey: str;
- Type: str
Table primary key name.
Classes
DynamodbTableClientBase
- Implements: IDynamodbTableClient
Base class for DynamodbTable
Client.
Initializers
bring ex;
new ex.DynamodbTableClientBase(tableName: str);
Name | Type | Description |
---|---|---|
tableName | str | the table name. |
tableName
Required
- Type: str
the table name.
Methods
Name | Description |
---|---|
deleteItem | Delete an item from the table. |
getItem | Get an item from the table. |
putItem | Put an item into the table. |
query | Return all items with a given partition key value. |
scan | Return one or more items and item attributes by accessing every item in a table or a secondary index. |
transactWriteItems | Perform a synchronous write operation that groups up to 100 action requests. |
updateItem | Get an item from the table. |
deleteItem
deleteItem(key: Json): void
Delete an item from the table.
key
Required
- Type: Json
getItem
getItem(key: Json): Json
Get an item from the table.
key
Required
- Type: Json
putItem
putItem(item: Json, props?: DynamodbTablePutItemProps): void
Put an item into the table.
item
Required
- Type: Json
props
Optional
query
query(props: DynamodbTableQueryProps): DynamodbTableQueryResult
Return all items with a given partition key value.
props
Required
- Type: DynamodbTableQueryProps
scan
scan(props?: DynamodbTableScanProps): DynamodbTableScanResult
Return one or more items and item attributes by accessing every item in a table or a secondary index.
props
Optional
- Type: DynamodbTableScanProps
transactWriteItems
transactWriteItems(props: DynamodbTransactWriteItemsProps): void
Perform a synchronous write operation that groups up to 100 action requests.
props
Required
updateItem
updateItem(key: Json, props?: DynamodbTableUpdateItemProps): Json
Get an item from the table.
key
Required
- Type: Json
props
Optional
RedisClientBase
- Implements: IRedisClient
Base class for Redis
Client.
Initializers
bring ex;
new ex.RedisClientBase();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
del | Removes the specified key. |
get | Get value at given key. |
hget | Returns the value associated with field in the hash stored at key. |
hset | Sets the specified field to respective value in the hash stored at key. |
rawClient | Get raw redis client (currently IoRedis). |
sadd | Add the specified members to the set stored at key. |
set | Set key value pair. |
smembers | Returns all the members of the set value stored at key. |
url | Get url of redis server. |
del
del(key: str): num
Removes the specified key.
key
Required
- Type: str
get
get(key: str): str
Get value at given key.
key
Required
- Type: str
hget
hget(key: str, field: str): str
Returns the value associated with field in the hash stored at key.
key
Required
- Type: str
field
Required
- Type: str
hset
hset(key: str, field: str, value: str): num
Sets the specified field to respective value in the hash stored at key.
key
Required
- Type: str
field
Required
- Type: str
value
Required
- Type: str
rawClient
rawClient(): any
Get raw redis client (currently IoRedis).
sadd
sadd(key: str, value: str): num
Add the specified members to the set stored at key.
key
Required
- Type: str
value
Required
- Type: str
set
set(key: str, value: str): void
Set key value pair.
key
Required
- Type: str
value
Required
- Type: str
smembers
smembers(key: str): MutArray<str>
Returns all the members of the set value stored at key.
key
Required
- Type: str
url
url(): str
Get url of redis server.
Structs
DynamodbTableProps
Properties for DynamodbTable
.
Initializer
bring ex;
let DynamodbTableProps = ex.DynamodbTableProps{ ... };
Properties
Name | Type | Description |
---|---|---|
attributeDefinitions | Json | Table attribute definitions. |
hashKey | str | Hash key for this table. |
name | str | The table's name. |
rangeKey | str | Range key for this table. |
attributeDefinitions
Required
attributeDefinitions: Json;
- Type: Json
Table attribute definitions.
e.g. { "myKey": "S", "myOtherKey": "S" }.
hashKey
Required
hashKey: str;
- Type: str
Hash key for this table.
name
Required
name: str;
- Type: str
The table's name.
rangeKey
Optional
rangeKey: str;
- Type: str
- Default: undefined
Range key for this table.
DynamodbTablePutItemProps
Properties for DynamodbTable.putItem
.
Initializer
bring ex;
let DynamodbTablePutItemProps = ex.DynamodbTablePutItemProps{ ... };
Properties
Name | Type | Description |
---|---|---|
conditionExpression | str | A condition that must be satisfied in order for an operation to succeed. |
conditionExpression
Optional
conditionExpression: str;
- Type: str
- Default: undefined
A condition that must be satisfied in order for an operation to succeed.
DynamodbTableQueryProps
Properties for DynamodbTable.query
.
Initializer
bring ex;
let DynamodbTableQueryProps = ex.DynamodbTableQueryProps{ ... };
Properties
Name | Type | Description |
---|---|---|
keyConditionExpression | str | The condition that specifies the key values for items to be retrieved by the Query action. |
consistentRead | bool | Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; |
exclusiveStartKey | Json | The primary key of the first item that this operation will evaluate. |
expressionAttributeNames | Json | One or more substitution tokens for attribute names in an expression. |
expressionAttributeValues | Json | One or more values that can be substituted in an expression. |
filterExpression | str | A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you. |
indexName | str | The name of an index to query. |
limit | num | The maximum number of items to evaluate (not necessarily the number of matching items). |
projectionExpression | str | A string that identifies one or more attributes to retrieve from the table. |
returnConsumedCapacity | str | Determines the level of detail about either provisioned or on-demand throughput consumption. |
scanIndexForward | bool | Specifies the order for index traversal. |
select | str | The attributes to be returned in the result. |
keyConditionExpression
Required
keyConditionExpression: str;
- Type: str
The condition that specifies the key values for items to be retrieved by the Query action.
consistentRead
Optional
consistentRead: bool;
- Type: bool
- Default: false
Determines the read consistency model: If set to true, then the operation uses strongly consistent reads;
otherwise, the operation uses eventually consistent reads.
exclusiveStartKey
Optional
exclusiveStartKey: Json;
- Type: Json
- Default: undefined
The primary key of the first item that this operation will evaluate.
expressionAttributeNames
Optional
expressionAttributeNames: Json;
- Type: Json
- Default: undefined
One or more substitution tokens for attribute names in an expression.
expressionAttributeValues
Optional
expressionAttributeValues: Json;
- Type: Json
- Default: undefined
One or more values that can be substituted in an expression.
filterExpression
Optional
filterExpression: str;
- Type: str
- Default: undefined
A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you.
indexName
Optional
indexName: str;
- Type: str
- Default: undefined
The name of an index to query.
limit
Optional
limit: num;
- Type: num
- Default: undefined
The maximum number of items to evaluate (not necessarily the number of matching items).
projectionExpression
Optional
projectionExpression: str;
- Type: str
- Default: undefined
A string that identifies one or more attributes to retrieve from the table.
returnConsumedCapacity
Optional
returnConsumedCapacity: str;
- Type: str
- Default: "NONE"
Determines the level of detail about either provisioned or on-demand throughput consumption.
scanIndexForward
Optional
scanIndexForward: bool;
- Type: bool
- Default: true
Specifies the order for index traversal.
select
Optional
select: str;
- Type: str
- Default: undefined
The attributes to be returned in the result.
DynamodbTableQueryResult
Result for DynamodbTable.query
.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html#API_Scan_ResponseSyntax
Initializer
bring ex;
let DynamodbTableQueryResult = ex.DynamodbTableQueryResult{ ... };
Properties
Name | Type | Description |
---|---|---|
count | num | The number of items in the response. |
items | MutArray<Json> | An array of item attributes that match the scan criteria. |
scannedCount | num | The number of items evaluated, before any QueryFilter is applied. |
consumedCapacity | Json | The capacity units consumed by the Query operation. |
lastEvaluatedKey | Json | The primary key of the item where the operation stopped, inclusive of the previous result set. |
count
Required
count: num;
- Type: num
The number of items in the response.
items
Required
items: MutArray<Json>;
- Type: MutArray<Json>
An array of item attributes that match the scan criteria.
scannedCount
Required
scannedCount: num;
- Type: num
The number of items evaluated, before any QueryFilter is applied.
consumedCapacity
Optional
consumedCapacity: Json;
- Type: Json
The capacity units consumed by the Query operation.
lastEvaluatedKey
Optional
lastEvaluatedKey: Json;
- Type: Json
The primary key of the item where the operation stopped, inclusive of the previous result set.
DynamodbTableScanProps
Properties for DynamodbTable.scan
.
Initializer
bring ex;
let DynamodbTableScanProps = ex.DynamodbTableScanProps{ ... };
Properties
Name | Type | Description |
---|---|---|
consistentRead | bool | Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; |
exclusiveStartKey | Json | The primary key of the first item that this operation will evaluate. |
expressionAttributeNames | Json | One or more substitution tokens for attribute names in an expression. |
expressionAttributeValues | Json | One or more values that can be substituted in an expression. |
filterExpression | str | A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you. |
indexName | str | The name of an index to query. |
limit | num | The maximum number of items to evaluate (not necessarily the number of matching items). |
projectionExpression | str | A string that identifies one or more attributes to retrieve from the table. |
returnConsumedCapacity | str | Determines the level of detail about either provisioned or on-demand throughput consumption. |
segment | num | For a parallel Scan request, Segment identifies an individual segment to be scanned by an application worker. |
select | str | The attributes to be returned in the result. |
totalSegments | num | For a parallel Scan request, TotalSegments represents the total number of segments into which the Scan operation will be divided. |
consistentRead
Optional
consistentRead: bool;
- Type: bool
- Default: false
Determines the read consistency model: If set to true, then the operation uses strongly consistent reads;
otherwise, the operation uses eventually consistent reads.
exclusiveStartKey
Optional
exclusiveStartKey: Json;
- Type: Json
- Default: undefined
The primary key of the first item that this operation will evaluate.
expressionAttributeNames
Optional
expressionAttributeNames: Json;
- Type: Json
- Default: undefined
One or more substitution tokens for attribute names in an expression.
expressionAttributeValues
Optional
expressionAttributeValues: Json;
- Type: Json
- Default: undefined
One or more values that can be substituted in an expression.
filterExpression
Optional
filterExpression: str;
- Type: str
- Default: undefined
A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you.
indexName
Optional
indexName: str;
- Type: str
- Default: undefined
The name of an index to query.
limit
Optional
limit: num;
- Type: num
- Default: undefined
The maximum number of items to evaluate (not necessarily the number of matching items).
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html#DDB-Scan-request-Limit
projectionExpression
Optional
projectionExpression: str;
- Type: str
- Default: undefined
A string that identifies one or more attributes to retrieve from the table.
returnConsumedCapacity
Optional
returnConsumedCapacity: str;
- Type: str
- Default: "NONE"
Determines the level of detail about either provisioned or on-demand throughput consumption.
segment
Optional
segment: num;
- Type: num
- Default: 0
For a parallel Scan request, Segment identifies an individual segment to be scanned by an application worker.
select
Optional
select: str;
- Type: str
- Default: undefined
The attributes to be returned in the result.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html#DDB-Scan-request-Select
totalSegments
Optional
totalSegments: num;
- Type: num
- Default: 1
For a parallel Scan request, TotalSegments represents the total number of segments into which the Scan operation will be divided.
DynamodbTableScanResult
Result for DynamodbTable.scan
.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html#API_Scan_ResponseSyntax
Initializer
bring ex;
let DynamodbTableScanResult = ex.DynamodbTableScanResult{ ... };
Properties
Name | Type | Description |
---|---|---|
count | num | The number of items in the response. |
items | MutArray<Json> | An array of item attributes that match the scan criteria. |
scannedCount | num | The number of items evaluated, before any ScanFilter is applied. |
consumedCapacity | Json | The capacity units consumed by the Scan operation. |
lastEvaluatedKey | Json | The primary key of the item where the operation stopped, inclusive of the previous result set. |
count
Required
count: num;
- Type: num
The number of items in the response.
items
Required
items: MutArray<Json>;
- Type: MutArray<Json>
An array of item attributes that match the scan criteria.
scannedCount
Required
scannedCount: num;
- Type: num
The number of items evaluated, before any ScanFilter is applied.
consumedCapacity
Optional
consumedCapacity: Json;
- Type: Json
The capacity units consumed by the Scan operation.
lastEvaluatedKey
Optional
lastEvaluatedKey: Json;
- Type: Json
The primary key of the item where the operation stopped, inclusive of the previous result set.
DynamodbTableUpdateItemProps
Properties for DynamodbTable.updateItem
.
Initializer
bring ex;
let DynamodbTableUpdateItemProps = ex.DynamodbTableUpdateItemProps{ ... };
Properties
Name | Type | Description |
---|---|---|
expressionAttributeValues | Json | One or more values that can be substituted in an expression. |
updateExpression | str | An expression that defines one or more attributes to be updated. |
expressionAttributeValues
Optional
expressionAttributeValues: Json;
- Type: Json
- Default: undefined
One or more values that can be substituted in an expression.
updateExpression
Optional
updateExpression: str;
- Type: str
- Default: undefined
An expression that defines one or more attributes to be updated.
DynamodbTransactWriteItem
Dynamodb transact write operation.
Initializer
bring ex;
let DynamodbTransactWriteItem = ex.DynamodbTransactWriteItem{ ... };
Properties
Name | Type | Description |
---|---|---|
delete | DynamodbTransactWriteItemDeleteProps | A request to perform a delete operation. |
put | DynamodbTransactWriteItemPutProps | A request to perform a put operation. |
update | DynamodbTransactWriteItemUpdateProps | A request to perform a update operation. |
delete
Optional
delete: DynamodbTransactWriteItemDeleteProps;
A request to perform a delete operation.
put
Optional
put: DynamodbTransactWriteItemPutProps;
A request to perform a put operation.
update
Optional
update: DynamodbTransactWriteItemUpdateProps;
A request to perform a update operation.
DynamodbTransactWriteItemDeleteProps
Properties for transact write item's delete operation.
Initializer
bring ex;
let DynamodbTransactWriteItemDeleteProps = ex.DynamodbTransactWriteItemDeleteProps{ ... };
Properties
Name | Type | Description |
---|---|---|
key | Json | The item to delete. |
key
Required
key: Json;
- Type: Json
The item to delete.
DynamodbTransactWriteItemPutProps
Properties for transact write item's update operation.
Initializer
bring ex;
let DynamodbTransactWriteItemPutProps = ex.DynamodbTransactWriteItemPutProps{ ... };
Properties
Name | Type | Description |
---|---|---|
item | Json | The item to put. |
conditionExpression | str | A condition that must be satisfied in order for an operation to succeed. |
item
Required
item: Json;
- Type: Json
The item to put.
conditionExpression
Optional
conditionExpression: str;
- Type: str
- Default: undefined
A condition that must be satisfied in order for an operation to succeed.
DynamodbTransactWriteItemsProps
Properties for DynamodbTable.transactWriteItems
.
Initializer
bring ex;
let DynamodbTransactWriteItemsProps = ex.DynamodbTransactWriteItemsProps{ ... };
Properties
Name | Type | Description |
---|---|---|
transactItems | MutArray<DynamodbTransactWriteItem> | The write transact items. |
transactItems
Required
transactItems: MutArray<DynamodbTransactWriteItem>;
- Type: MutArray<DynamodbTransactWriteItem>
The write transact items.
DynamodbTransactWriteItemUpdateProps
Properties for transact write item's update operation.
Initializer
bring ex;
let DynamodbTransactWriteItemUpdateProps = ex.DynamodbTransactWriteItemUpdateProps{ ... };
Properties
Name | Type | Description |
---|---|---|
key | Json | The item to update. |
expressionAttributeValues | Json | One or more values that can be substituted in an expression. |
updateExpression | str | An expression that defines one or more attributes to be updated. |
key
Required
key: Json;
- Type: Json
The item to update.
expressionAttributeValues
Optional
expressionAttributeValues: Json;
- Type: Json
- Default: undefined
One or more values that can be substituted in an expression.
updateExpression
Optional
updateExpression: str;
- Type: str
- Default: undefined
An expression that defines one or more attributes to be updated.
TableProps
Properties for Table
.
Initializer
bring ex;
let TableProps = ex.TableProps{ ... };
Properties
Name | Type | Description |
---|---|---|
columns | MutMap<ColumnType> | The table's columns. |
initialRows | MutMap<Json> | The table's initial rows. |
name | str | The table's name. |
primaryKey | str | The table's primary key. |
columns
Optional
columns: MutMap<ColumnType>;
- Type: MutMap<ColumnType>
- Default: undefined
The table's columns.
initialRows
Optional
initialRows: MutMap<Json>;
- Type: MutMap<Json>
- Default: undefined
The table's initial rows.
name
Optional
name: str;
- Type: str
- Default: undefined
The table's name.
primaryKey
Optional
primaryKey: str;
- Type: str
- Default: undefined
The table's primary key.
No two rows can have the same value for the primary key.
Enums
ColumnType
Table column types.
Members
Name | Description |
---|---|
STRING | String type. |
NUMBER | Number type. |
BOOLEAN | Bool type. |
DATE | Date type. |
JSON | Json type. |
STRING
String type.
NUMBER
Number type.
BOOLEAN
Bool type.
DATE
Date type.
JSON
Json type.