DynamoDbPutItemStatement

DynamoDbPutItemStatement

new DynamoDbPutItemStatement(opt)

SQL-ish PutItem statement class for AWS DynamoDB.

Source:
Parameters:
Name Type Description
opt string | object

SQL-ish PutItem statement as string or parameter object for PutItem API.

Methods

run(args, callback) → {undefined}

Run the statement in async.

Source:
See:
Parameters:
Name Type Description
args array | object

This parameter can be what is same to the parameter of setValues method. If it is an array, it contains the values of attributes. Or if it is an object, its key that do not start with ':' represents the attribute names.

callback function

The callback function to get an error. The declaration is (err) => { ... }.

Returns:
Type:
undefined

setValues(values) → {undefined}

Set an item to this statement. The item will be put to the DynamoDB when this statement ran.

Source:
Parameters:
Name Type Description
values array | object

If this is array, it must contain values as same order for the attributes specified as SQL in the constructor. If this is an object, the key is an attribute names. Whether each cases above, the attribute names must be specified by SQL-ish statement at the constructor. The values will be converted to DynamoDB Map Object. So, you can specify a value as is.

Returns:
Type:
undefined