{"id":24514642,"url":"https://github.com/jvan100/dynamo-request-builder","last_synced_at":"2026-02-02T11:35:48.966Z","repository":{"id":263837469,"uuid":"891522553","full_name":"jvan100/dynamo-request-builder","owner":"jvan100","description":"An intuitive DynamoDB request building API for JavaScript","archived":false,"fork":false,"pushed_at":"2024-12-02T11:33:38.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T03:47:52.769Z","etag":null,"topics":["aws","aws-dynamodb","dynamodb","javascript","javascript-library","request-builder"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvan100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-20T13:41:00.000Z","updated_at":"2024-12-02T11:32:16.000Z","dependencies_parsed_at":"2024-11-20T15:34:11.095Z","dependency_job_id":"b32237a3-c87a-495c-a5a7-ad19c33c354f","html_url":"https://github.com/jvan100/dynamo-request-builder","commit_stats":null,"previous_names":["jvan100/dynamo-request-builder"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jvan100/dynamo-request-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvan100%2Fdynamo-request-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvan100%2Fdynamo-request-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvan100%2Fdynamo-request-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvan100%2Fdynamo-request-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvan100","download_url":"https://codeload.github.com/jvan100/dynamo-request-builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvan100%2Fdynamo-request-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29011497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T10:37:29.253Z","status":"ssl_error","status_checked_at":"2026-02-02T10:37:28.644Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-dynamodb","dynamodb","javascript","javascript-library","request-builder"],"created_at":"2025-01-22T01:14:00.746Z","updated_at":"2026-02-02T11:35:48.952Z","avatar_url":"https://github.com/jvan100.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamo Request Builder\nAn intuitive DynamoDB request building API for JavaScript.\n\n## Contents\n- [Installation](#installation)\n- [Creating Requests](#creating-requests)\n- [Attributes](#attributes)\n- [Logical Operators](#logical-operators)\n- [Executing Requests](#executing-requests)\n\n## Installation\n\n```shell\nnpm install dynamo-request-builder\n```\n\n## Creating Requests\n\nUse the `DynamoRequestBuilderCreator` with a DynamoDB `DocumentClient` to create a `DynamoRequestBuilder`.\n\n```javascript\nimport DynamoRequestBuilderCreator from \"dynamo-request-builder\";\n\nconst requestBuilder = new DynamoRequestBuilderCreator(dynamoDocClient).create(\"table_name\");\n```\n\n### Delete\n\n```javascript\nimport { attribute, sizeOf } from \"dynamo-request-builder/attributes\";\nimport { or } from \"dynamo-request-builder/operators\";\nimport { ReturnValues } from \"dynamo-request-builder/return-values\";\n\nconst request = requestBuilder.delete(\"partitionKeyName\", \"partitionKeyValue\")\n  .withSortKey(\"sortKeyName\", \"sortKeyValue\") // Sort key condition\n  .onlyIfAttribute(\"attribute\").eq(\"value\") // Add an attribute condition\n  .onlyIfSizeOfAttribute(\"attribute\").lte(1) // Add a size of attribute condition\n  .onlyIf(\n    or(attribute(\"attribute1\").gte(1), attribute(\"attribute2\").contains(\"value\")),\n    sizeOf(\"attribute3\").eq(2)\n  ) // Add multiple attribute conditions\n  .returnValues(ReturnValues.AllOld); // Specify values to return\n```\n\n### Get\n```javascript\nconst request = requestBuilder.get(\"partitionKeyName\", \"partitionKeyValue\")\n  .withSortKey(\"sortKeyName\", \"sortKeyValue\") // Sort key condition\n  .getAttributes(\"attribute\", \"attribute[0]\", \"attribute[0].subAttribute\") // Specify attributes to retrieve\n  .consistentRead(); // Use consistent read\n```\n\n### Put\n```javascript\nimport { attribute, sizeOf } from \"dynamo-request-builder/attributes\";\nimport { not } from \"dynamo-request-builder/operators\";\nimport { ReturnValues } from \"dynamo-request-builder/return-values\";\n\nconst item = {\n  ...\n};\n\nconst request = requestBuilder.put(item)\n  .ifItemNotExists(\"partitionKeyName\", \"sortKeyName\") // Only put the item if it doesn't already exist\n  .onlyIfAttribute(\"attribute\").eq(\"value\") // Add an attribute condition\n  .onlyIfSizeOfAttribute(\"attribute\").lte(1) // Add a size of attribute condition\n  .onlyIf(\n\t  not(attribute(\"attribute1\").gte(1)),\n\t  sizeOf(\"attribute3\").eq(2)\n  ) // Add multiple attribute conditions\n  .returnValues(ReturnValues.AllOld); // Specify values to return\n```\n\n### Query\n```javascript\nimport { attribute, sizeOf } from \"dynamo-request-builder/attributes\";\nimport { or } from \"dynamo-request-builder/operators\";\n\nconst request = requestBuilder.query(\"partitionKeyName\", \"partitionKeyValue\")\n  .whereSortKey(\"sortKeyName\").beginsWith(\"value\") // Add a sort key condition\n  .whereAttribute(\"attribute\").eq(\"value\") // Add an attribute condition\n  .whereSizeOfAttribute(\"attribute\").lt(1) // Add a size of attribute condition\n  .where(\n    or(attribute(\"attribute1\").gte(1), attribute(\"attribute2\").contains(\"value\")),\n    sizeOf(\"attribute3\").eq(2)\n  ) // Add multiple attribute conditions\n  .getAttributes(\"attribute\", \"attribute[0]\", \"attribute[0].subAttribute\") // Specify attributes to retrieve\n  .limit(5) // Specify a limit on the number of items to return\n  .useIndex(\"indexName\") // Specify an index to use\n  .scanIndexDescending(); // Scan the index in descending order\n```\n\n### Scan\n```javascript\nimport { attribute, sizeOf } from \"dynamo-request-builder/attributes\";\nimport { or } from \"dynamo-request-builder/operators\";\n\nconst request = requestBuilder.scan()\n  .whereAttribute(\"attribute\").eq(\"value\") // Add an attribute condition\n  .whereSizeOfAttribute(\"attribute\").lt(1) // Add a size of attribute condition\n  .where(\n    or(attribute(\"attribute1\").gte(1), attribute(\"attribute2\").contains(\"value\")),\n    sizeOf(\"attribute3\").eq(2)\n  ) // Add multiple attribute conditions\n  .getAttributes(\"attribute\", \"attribute[0]\", \"attribute[0].subAttribute\") // Specify attributes to retrieve\n  .limit(5) // Specify a limit on the number of items to return\n  .useIndex(\"indexName\") // Specify an index to use\n```\n\n### Update\n```javascript\nimport { attribute, sizeOf, update } from \"dynamo-request-builder/attributes\";\nimport { or } from \"dynamo-request-builder/operators\";\n\nconst request = requestBuilder.update(\"partitionKeyName\", \"partitionKeyValue\")\n  .withSortKey(\"sortKeyName\", \"sortKeyValue\") // Sort key condition\n  .updateAttribute(\"attribute\").incrementBy(5) // Add an update operation\n  .operations(update(\"attribute1\").add(1, 2, 3), update(\"attribute2\").remove()) // Add multiple update operations\n  .onlyIfAttribute(\"attribute\").eq(\"value\") // Add an attribute condition\n  .onlyIfSizeOfAttribute(\"attribute\").lte(1) // Add a size of attribute condition\n  .onlyIf(\n    or(attribute(\"attribute1\").gte(1), attribute(\"attribute2\").contains(\"value\")),\n    sizeOf(\"attribute3\").eq(2)\n  ) // Add multiple attribute conditions\n  .returnValues(UpdateReturnValues.UpdatedNew); // Specify values to return\n```\n\nYou can check the generated request parameters for yourself by accessing `request.params`.\n\n## Attributes\n\nThe ability to select specific attributes and apply constraint conditions and update operations to them are needed for certain expressions.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eAttribute Type\u003c/th\u003e\n        \u003cth\u003eAttribute Selectors\u003c/th\u003e\n        \u003cth\u003eUse Cases\u003c/th\u003e\n        \u003cth\u003eMethods\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eCondition Attribute\u003c/td\u003e\n        \u003ctd style=\"text-align: center\"\u003e\u003ccode\u003eattribute(attributePath)\u003c/code\u003e, \u003ccode\u003esizeOf(attributePath)\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            Condition Expressions\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003eonlyIfAttribute(attributePath)\u003c/code\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eonlyIfSizeOfAttribute(attributePath)\u003c/code\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eonlyIf(...conditionExpressions)\u003c/code\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n            \u003cbr\u003e\n            Filter Expressions\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003ewhereAttribute(attributePath)\u003c/code\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003ewhereSizeOfAttribute(attributePath)\u003c/code\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003ewhere(...filterExpressions)\u003c/code\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n            \u003cbr\u003e\n            Key Condition Expressions\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003ewhereSortKey(sortKeyName)\u003c/code\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003ebeginsWith(subString)\u003c/code\u003e - Check if the string attribute begins with a substring\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003ebetween(value1, value2)\u003c/code\u003e - Check if the numerical attribute is between two values\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eeq(value)\u003c/code\u003e - Check if the attribute is equal to a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003ene(value)\u003c/code\u003e - Check if the attribute is not equal to a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003elt(value)\u003c/code\u003e - Check if the numerical attribute is less than a value \u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003egt(value)\u003c/code\u003e - Check if the numerical attribute is greater than a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003elte(value)\u003c/code\u003e - Check if the numerical attribute is less than or equal to a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003egte(value)\u003c/code\u003e - Check if the numerical attribute is greater than or equal to a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eexists()\u003c/code\u003e - Check if the attribute exists\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003enotExists()\u003c/code\u003e - Check if the attribute doesn't exist\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003econtains(value)\u003c/code\u003e - Check if a string contains a substring or a set or list contains an element\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003enotContains(value)\u003c/code\u003e - Check if a string doesn't contain a substring or a set or list doesn't contain an element\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eofType(type)\u003c/code\u003e - Check if an attribute is of a type\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003ein(...values)\u003c/code\u003e - Check if an attribute is in a list of values\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eUpdate Operation Attribute\u003c/td\u003e\n        \u003ctd style=\"text-align: center\"\u003e\u003ccode\u003eupdate(attributePath)\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            Update Expressions\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003eupdateAttribute(attributePath)\u003c/code\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eoperations(...updateExpressions)\u003c/code\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003eadd(...values)\u003c/code\u003e - Add a numerical value to the numerical attribute or values to the set attribute\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eincrement()\u003c/code\u003e - Increment the numerical attribute by 1\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eincrementBy(value)\u003c/code\u003e - Increment the numerical attribute by a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003edecrement()\u003c/code\u003e - Decrement the numerical attribute by 1\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003edecrementBy(value)\u003c/code\u003e - Decrement the numerical attribute by a value\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eappendToStartOfList(...values)\u003c/code\u003e - Append values to the start of the list attribute\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eappendToEndOfList(...values)\u003c/code\u003e - Append values to the end of the list attribute\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eset(value, ifNotExists = false)\u003c/code\u003e - Set the value of the attribute (optional only set the value if the attribute doesn't exist)\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eremove()\u003c/code\u003e - Remove the attribute\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eremoveFromListAt(...indices)\u003c/code\u003e - Remove elements from the list attribute at the specific indices\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eremoveFromSet(...values)\u003c/code\u003e - Remove values from the set attribute\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Logical Operators\n\nLogical operators are used to extend the logic of condition expressions, filter expressions and key condition expressions.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOperator\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003enot(conditionExpression)\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eThe condition expression must evaluate to \u003ccode\u003efalse\u003c/code\u003e for the result to be \u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eand(...conditionExpressions)\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eAll condition expressions must evaluate to \u003ccode\u003etrue\u003c/code\u003e for the result to be \u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eor(...conditionExpressions)\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eOnly one condition expression must evaluate to \u003ccode\u003etrue\u003c/code\u003e for the result to be \u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Executing Requests\n\nOnce a request has been created, it can be executed and the return values can be used.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eRequest Type\u003c/th\u003e\n        \u003cth\u003eInheriting Types\u003c/th\u003e\n        \u003cth\u003eMethods\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eBaseRequest\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eAll\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eexecFullResponse()\u003c/code\u003e - Execute and return the full response\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eReadManyRequest\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eQueryRequest\u003c/code\u003e, \u003ccode\u003eScanRequest\u003c/code\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003ccode\u003eexec()\u003c/code\u003e - Execute and return requested items\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eexecCount()\u003c/code\u003e - Execute and return the count of the number of items found\u003c/li\u003e\n                \u003cli\u003e\u003ccode\u003eexecSingle()\u003c/code\u003e - Execute and return a single item\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eWriteRequest\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eDeleteRequest\u003c/code\u003e, \u003ccode\u003ePutRequest\u003c/code\u003e, \u003ccode\u003eUpdateRequest\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eexec()\u003c/code\u003e - Execute and return requested attributes\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eGetRequest\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eNone\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eexec()\u003c/code\u003e - Execute and return the requested item\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvan100%2Fdynamo-request-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvan100%2Fdynamo-request-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvan100%2Fdynamo-request-builder/lists"}