AccessKey: AKIAIOSFODNN7EXAMPLE SecretKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html */ TableName: 'Thread', Wait : true, /* Wait until table status is ACTIVE */ AttributeDefinitions: [ /*Below two columns used in Composite Primary Key */ { AttributeName: 'ForumName', AttributeType: 'S' }, { AttributeName: 'PostId', AttributeType: 'N' } ], KeySchema: [ { AttributeName: 'ForumName', KeyType: 'HASH' }, { AttributeName: 'PostId', KeyType: 'RANGE' } ], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
Property Name | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ResultsetType | ResultSet Type. It can be None, FullResultset or SingleValue. When FullResultset is specified then you have to store result in Object type variable. Full result is ADO.net DataTable. SingleValue is Object datatype
|
||||||||||||||||||||||||||||
CommandType | Source of SQL Statement. It can be DirectValue or Variable
|
||||||||||||||||||||||||||||
SqlStatementSourceType | Source of SQL Statement. It can be DirectValue or Variable
|
||||||||||||||||||||||||||||
ResultsetVariable | Variable name which will store Full resultset (ADO.net DataTable) or single value of result. Variable type must be object datatype if storing full resultset | ||||||||||||||||||||||||||||
Timeout | Command timeout in second. 0 means no command timeout | ||||||||||||||||||||||||||||
SqlStatementSource | If SqlSourceType=DirectValue then this property holds SQL Statement. | ||||||||||||||||||||||||||||
SqlStatementVariable | If SqlSourceType=Variable then this property holds Variable name which where SQL statement is stored | ||||||||||||||||||||||||||||
Connection | Connection where you want to execute sql command | ||||||||||||||||||||||||||||
LoggingMode |
|
||||||||||||||||||||||||||||
PrefixTimestamp | When you enable this property it will prefix timestamp before Log messages. |
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html */ TableName: 'Thread', Wait : true, /* Wait until table status is ACTIVE */ AttributeDefinitions: [ /*Below two columns used in Composite Primary Key */ { AttributeName: 'ForumName', AttributeType: 'S' }, { AttributeName: 'PostId', AttributeType: 'N' } ], KeySchema: [ { AttributeName: 'ForumName', KeyType: 'HASH' }, { AttributeName: 'PostId', KeyType: 'RANGE' } ], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html */ TableName: 'Thread', Wait: true, /* Wait until table status is ACTIVE */ AttributeDefinitions: [ /*Below two columns used in Composite Primary Key */ { AttributeName: 'ForumName', AttributeType: 'S' }, { AttributeName: 'PostId', AttributeType: 'N' }, /*Below used in Index*/ { AttributeName: 'LastPostDateTime', AttributeType: 'S' } ], KeySchema: [ { AttributeName: 'ForumName', KeyType: 'HASH' }, { AttributeName: 'PostId', KeyType: 'RANGE' } ], LocalSecondaryIndexes: [ { IndexName: 'LastPostIndex', KeySchema: [ { AttributeName: 'ForumName', KeyType: 'HASH' }, { AttributeName: 'LastPostDateTime', KeyType: 'RANGE' } ], Projection: { ProjectionType: 'KEYS_ONLY' } } ], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html */ TableName: 'Thread', Wait : true, /* Wait until table status is ACTIVE */ AttributeDefinitions: [ /*Below two columns used in Composite Primary Key */ { AttributeName: 'ForumName', AttributeType: 'S' }, { AttributeName: 'PostId', AttributeType: 'N' } ], KeySchema: [ { AttributeName: 'ForumName', KeyType: 'HASH' }, { AttributeName: 'PostId', KeyType: 'RANGE' } ], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html */ /* Wait until table is back to ACTIVE status after you change something e.g. Index, Provision Throughput etc. */ Wait: true, TableName: 'Thread', ProvisionedThroughput: { ReadCapacityUnits: 6, WriteCapacityUnits: 6 } }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html */ Wait: true, /* Wait until table status is ACTIVE */ TableName: 'Thread', AttributeDefinitions: [ { AttributeName: 'PostCategory', AttributeType: 'S' }, { AttributeName: 'Author', AttributeType: 'S' } ], GlobalSecondaryIndexUpdates: [ { Create: { IndexName: 'PostCategoryIndex', KeySchema: [ { AttributeName: 'PostCategory', KeyType: 'HASH' }, { AttributeName: 'Author', KeyType: 'RANGE' } ], Projection: { ProjectionType: 'KEYS_ONLY' } } } /* , { Update: { IndexName: 'SomeExistingGSIndex', ProvisionedThroughput: { ReadCapacityUnits: 6, WriteCapacityUnits: 6 } } } */ ] }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html */ TableName: 'Thread', Wait: true /* Use this option to wait until operation is done */ }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html */ TableName: 'Thread', Wait: true /* Use this option to wait until operation is done */ }
{ /*For more info visit : http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.html */ }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html */ { TableName: 'Thread' /*Use below attribute to get only single attribute. For more information on how to write JSON Path filter check this link: http://goessner.net/articles/JsonPath/ PropertyFilter: 'Table.ItemCount' */ }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html */ { TableName: 'Thread', /*For more information on how to write JSON Path filter check this link: http://goessner.net/articles/JsonPath/ */ PropertyFilter: 'Table.ItemCount' }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html */ { TableName: 'Thread', /*For more information on how to write JSON Path filter check this link: http://goessner.net/articles/JsonPath/ */ PropertyFilter: 'Table.TableSizeBytes' }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html */ { TableName: 'Thread', /*For more information on how to write JSON Path filter check this link: http://goessner.net/articles/JsonPath/ */ PropertyFilter: '$.Table.LocalSecondaryIndexes[?(@IndexName=='LastPostIndex')].IndexSizeBytes' }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html */ { "TableName": "Thread", "Item": { "LastPostDateTime": { "S": "201303190422" }, "Tags": { "SS": ["Update","Multiple Items","HelpMe"] }, "ForumName": { "S": "Amazon DynamoDB" }, "PostId": { "N": 100 }, "Message": { "S": "I want to update multiple items in a single API call. What's the best way to do that?" }, "Subject": { "S": "How do I update multiple items?" }, "LastPostedBy": { "S": "fred@example.com" } }, "ConditionExpression": "ForumName <> :f and Subject <> :s", "ExpressionAttributeValues": { ":f": {"S": "Amazon DynamoDB"}, ":s": {"S": "How do I update multiple items?"} } }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html */ { "TableName": "Thread", "Key": { "ForumName": { "S": "Amazon DynamoDB" }, "PostId": { "N": 100 } }, "ConditionExpression": "attribute_not_exists(Replies)", "ReturnValues": "ALL_OLD" }
/*For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html */ { "TableName": "Thread", "Key": { "ForumName": { "S": "Amazon DynamoDB" }, "PostId": { "N": 100 } }, "UpdateExpression": "set LastPostedBy = :val1", "ConditionExpression": "LastPostedBy = :val2", "ExpressionAttributeValues": { ":val1": {"S": "alice@example.com"}, ":val2": {"S": "fred@example.com"} }, "ReturnValues": "ALL_NEW" }
/* For more info check: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html List of reserved words: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html */ { "TableName": "Thread", "Key": { "ForumName": { "S": "Amazon DynamoDB" }, "PostId": { "N": 100 } }, "UpdateExpression": "set #P = :val1", "ConditionExpression": "LastPostedBy = :val2", "ExpressionAttributeNames": { "#P": {"S": "Status"} }, "ExpressionAttributeValues": { ":val1": {"S": "Success"}, ":val2": {"S": "fred@example.com"} }, "ReturnValues": "ALL_NEW" }
{ TableName: 'Thread', Items: [ {ForumName: 'Product 1',Subject:'How to return item?',PostId:1, LastPostDateTime:'2015-01-01',PostCategory:'Product',Tags:['Tag1','Tag2','Tag3'], Cost: 1200.50 }, {ForumName: 'Product 1',Subject:'How to order item?',PostId:2,LastPostDateTime:'2015-01-02',PostCategory:'Product',Tags:['Tag2','Tag3'], Cost: 100.50 }, {ForumName: 'Service 1',Subject:'How to use item?',PostId:1,LastPostDateTime:'2015-01-03',PostCategory:'Service',Tags:[]} ] }
{ TableName: 'Thread', Items: [ {ForumName: 'Product 1',PostId:1}, {ForumName: 'Service 1',PostId:1} ] }
SELECT top 10 * FROM Thread WHERE Subject LIKE 'H%' WITH (SCAN)
SELECT top 10 * FROM Thread WHERE ForumName = 'Product 1' AND PostId >= 1 WITH (QUERY)