Skip to content

Instantly share code, notes, and snippets.

@enlacee
Last active October 19, 2021 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enlacee/f93ff39b121cee797c081671ecf855b6 to your computer and use it in GitHub Desktop.
Save enlacee/f93ff39b121cee797c081671ecf855b6 to your computer and use it in GitHub Desktop.
deleteProducts.js
let IDS = [
["13a84e72-2d85-4852-9670-7adea92c8d4e", "1632326405429"],
["a010b860-7bd2-460e-8799-bc491670f294", "1632326405429"],
["1e543a6d-98e0-4150-b32a-097e688958b0", "1632326405429"],
["bc22a6e5-7545-40db-a0f6-3d63dc60be71", "1632326405429"],
["dcde6e06-3f84-4c4a-b6f3-f2787caf0677", "1632326405429"],
];
let dynamoObject = { "UE1NPRODTESTDBADYNH2H014": [] };
IDS.forEach(function(element, index) {
// Agrupate by blocks
// if (index >= 0 && index < 25) {
// if (index >= 25 && index < 50) {
// if (index >= 50 && index < 75) {
// if (index >= 75 && index < 100) {
// if (index >= 100 && index < 125) {
// if (index >= 125 && index < 150) {
// if (index >= 150 && index < 175) {
// if (index >= 175 && index < 200) {
if (index >= 200 && index < 225) {
let objDeleteRequest = {
"DeleteRequest": {
"Key": {
"ID": {
"S": element[0]
},
"dateTimeCreation": {
"N": element[1]
}
}
}
};
dynamoObject.UE1NPRODTESTDBADYNH2H014.push(objDeleteRequest);
}
});
// console.log(JSON.stringify(dynamoObject, null, 2))
console.log(JSON.stringify(dynamoObject))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment