-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
063112f
commit bd26441
Showing
2,349 changed files
with
1,826,937 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const AWS = require('aws-sdk') | ||
|
||
// New ID key | ||
|
||
const awsConfig = { | ||
"region": "", | ||
"endpoint": "", | ||
"accessKeyId": "" | ||
} | ||
AWS.config.update(awsConfig) | ||
|
||
const dynamoDB = new AWS.DynamoDB.DocumentClient() | ||
|
||
const fetchOneByKey = () => { | ||
const params = { | ||
TableName: '', | ||
Key: { | ||
"id": "" | ||
} | ||
} | ||
try { | ||
docClient.get(params, (error, data) => { | ||
if(error) { | ||
console.log("error: " + JSON.stringify(error, null, )) | ||
}else{ | ||
console.log(JSON.stringify(data,null,2)); | ||
} | ||
}) | ||
} catch (e) { | ||
console.log('error: ' + e) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const AWS = require('aws-sdk') | ||
|
||
// New ID key | ||
|
||
const awsConfig = { | ||
"region": "", | ||
"endpoint": "", | ||
"accessKeyId": "" | ||
} | ||
AWS.config.update(awsConfig) | ||
|
||
const dynamoDB = new AWS.DynamoDB.DocumentClient() | ||
|
||
const updateOne = (counter) => { | ||
const input = { | ||
"time": time.time(), | ||
"counter": counter // counter value here | ||
} | ||
|
||
const params = { | ||
TableName: '', | ||
Key: { | ||
'id': '' | ||
}, | ||
UpdateExpression: 'set counter = :counter', | ||
ExpressionAttributeValues: { | ||
':counter': counter | ||
} | ||
} | ||
|
||
try { | ||
dynamoDB.update(params, (error, data) => { | ||
if(error) { | ||
console.log("error: " + JSON.stringify(error, null, )) | ||
}else{ | ||
console.log(JSON.stringify(data,null,2)); | ||
} | ||
}) | ||
} catch (e) { | ||
console.log('error: ' + e) | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.