Questions tagged [amazon-dynamodb]

Amazon DynamoDB is an exclusive, privately owned cloud-native database that specializes in key-value and document storage. Its primary focus lies in its ability to scale horizontally, making it a highly efficient option. As a fully managed platform, it offers multi-region capabilities, allowing for seamless database operations across various locations. Additionally, DynamoDB comes equipped with enhanced security measures, backup and restoration features, as well as in-memory caching specifically designed for internet-scale applications. Although hosted on AWS, users also have the option of utilizing a local deployment solely intended for development and functional testing purposes. Notably, this cutting-edge technology is widely utilized by the e-commerce giant, amazon.com.

Leveraging batchWriteItem with dynamodb

I am trying to utilize batchWriteItem in my DynamoDB to add data to two tables: candidate table and user table. The formatted query is shown below: var user = { userid: usrid, role: 'candidate', password: vucrypt.encryptpass(pass) ...

Most efficient method: Exporting a DynamoDB table to a CSV file and saving it in an S3 bucket

Is there a more efficient way to export a DynamoDB table into an S3 bucket in CSV format? We already have a lambda function set up to update the DynamoDB table, but now we need to export the entire table. I came across a method of streaming directly from ...

Which authentication details should be utilized for deploying a React application on AWS?

After developing an app that leverages amplify for deployment and dynamodb for data retrieval, I am pondering the idea of using separate credentials solely for deployment purposes. The current set of credentials seems to be working fine for me, but is it r ...

Incorporate a new item into an array within DynamoDB that does not currently

I am attempting to update an attribute called items, which is a list of strings. Is it possible to update (append) the attribute only if it does not already exist? Something like a combination of list_append and if_not_exists. var params = { ... Upda ...

Storing files in DynamoDB using Reactjs is a convenient and efficient way

Is there a way to store resume files in an existing DynamoDB table that currently stores name and email information? I have attempted to do so using React's AWS package with the following code: <input name="my_file" onChange={e => upd ...

Transforming AWS CLI DynamoDB JSON output into standard JSON format

Is there a method for transforming the aws cli response for a dynamodb get-item request from dynamodb JSON format to standard JSON format? I am seeking an effective way to version an item that is being updated in a dynamodb table. I have experimented with ...

Order the data by the updatedAt attribute in sails-dynamodb

An issue has arisen where I need to organize found elements based on the updatedAt field, which is automatically created and updated. Below is the code in question: Model: module.exports = { attributes: { id:{ type: "string" ...

Tips for transferring a null value from a json to a dynamodb

When attempting to pass values one by one to a lambda function and store them in DynamoDB, the first value is saved as null. I have tried the following solutions: Added convertEmptyValues: true var doClient = new AWS.DynamoDB.DocumentClient({convertEmpt ...

Error in AWS Lambda: JSON parsing error due to unexpected token 't' at position 6

I'm currently working on a basic lambda function that utilizes a post request to insert data into DynamoDB. However, every time I deploy the lambda function and test it using Postman, I keep encountering a 502 Bad Gateway error. To troubleshoot this ...

Importing an array into DynamoDB using a JSON string with boto3

When it comes to uploading a JSON file to an AWS DynamoDB table in Python, I have been using a script that I found on this particular page. However, I am facing a challenge in understanding whether Python can be instructed to split a single string from the ...

Guide on obtaining Loopback 3 conditional 'datasources' and 'model-config': adhering to the provided steps does not yield results

After some tweaking, I managed to make it work partially by assuming that the local variations could only replace already defined structures. This means that I had to initially define the data sources 'DynamoDB' and 'mongo' in datasourc ...

Obtain information from a website, then initiate a lambda function to send an email and store the data in

As a beginner, I came across two different sets of instructions online. The first one was about using AWS Lambda to send data (Contact us - Email, Phone, etc) to my email via Amazon API Gateway and Amazon SES: https://aws.amazon.com/blogs/architecture/cre ...

The Design of DynamoDB Applications

Utilizing DynamoDB in conjunction with node.js and Express for developing REST APIs has been a beneficial choice for us. We have opted for Dynamo on the backend due to its operational simplicity. To streamline our usage of DynamoDB, we have incorporated t ...

Is it feasible to search through dynamodb using attributes other than hash and range keys?

Currently, I am utilizing boto library for connecting to dynamodb in Python. Despite my efforts, I have not come across any comprehensive tutorials on querying dynamodb. "What I require is the ability to retrieve the data from a table where a specifi ...

Creating a Universal Unique Identifier (UUID) in DynamoDB

One requirement of my database schema is an autoincrement primary key. How can I implement this feature efficiently? For interacting with DynamoDB, I rely on the dynode module specifically designed for Node.js. ...

Exclude JSON Property if it Lacks a Certain Value

I'm attempting to retrieve specific values from a DynamoDB database where the name is "john". The challenge I'm facing is that although I can fetch values containing name: john from a mapped list, I also receive additional unwanted values. When running th ...

The retrieval of data from AWS Dynamodb in Node.js is not done synchronously

I recently started working with Node.js and DynamoDB. I created a Node.js SDK to retrieve a single row from a DynamoDB table. The data is being fetched correctly, but there is a delay which is causing an error. Below is a snippet of my code: var AWS = re ...

Encountered an issue while attempting to insert a batch item into DynamoDB containing Mapvalues

I've had success using write batch items with the boto library. However, when attempting to add map values to the request, I encountered the following exception: Invalid type for parameter RequestItems.TestMap, value: {'PutRequest': {'Item': { ...

Exploring data in Dynamodb database

Utilizing Lambda, API-gateway, and DynamoDB with Python 3.6 for managing orders. I have a DynamoDB table structured as follows: orderId (primary Key|String) orderStatus (String) orderCode (String) date (String) The orderId field is unique. However, when ...

Exploring a table in AWS DynamoDB

Using DynamoDB for a new project is proving to be quite confusing. I've set up a table with a hash key named ID, which I'm making unique by setting it as a timestamp. When inserting data using Lambda, here's how it looks: var tableName = ...

Incorporate DynamoDb functionality into your Sails js application

Recently, I embarked on a project using Sailsjs with DynamoDB as the database. During my research, I came across a helpful package at https://github.com/dohzoh/sails-dynamodb. The documentation provided detailed instructions for the initial setup. After i ...

Mastering the art of utilizing GSI Index and FilterExpression in AWS DynamoDB querying

In my DynamoDB database table, I have the following structure. It consists of a primary key (ID) and a sort key (receivedTime). ID(primary key) receivedTime(sort key) Data ID1 1670739188 3 ID2 167072 ...

Retrieve all items from DynamoDB using a list of specified IDs

I am working with a table that has an attribute named id of type HASH. My goal is to retrieve all items from an array of ids. { TableName: `MyTable`, FilterExpression: 'id IN (:id)', ExpressionAttributeValues: { ':id': ids }, }; How can I fet ...

What is the best way to remove a specific item from a list of maps in DynamoDB based on a particular attribute value within the

Below is an example of a list I have: { "favorites": [ { "createdAt": 1448998673852, "entityId": "558da3de395b1aee2d6b7d2b", "type": "media" }, { "createdAt": 1448998789252, "entityId": "558da3de395b1aee2d6b7d83 ...

The error message thrown by DynamoDB BatchGet is always 'The key element supplied does not align with the schema'

I've been struggling with the DynamoDB batchGet operation for quite some time now. Here's my table definition using serverless: Resources: MyTable: Type: AWS::DynamoDB::Table DeletionPolicy: Retain Properties: TableName: MyTab ...

There was an issue parsing the parameter '--request-items' due to invalid JSON format. Decoding failed as no JSON object could be found

My current environment includes AWS cloud, DynamoDB, AWS Cloud9, Python, and JSON. I'm attempting to write these elements into a DynamoDB table using the command aws dynamodb batch-write-item --request-items file://Sensors.json in my Cloud9 CLI. However, ...

What is the process for changing a DynamoDB table from PROVISIONED to PAY_PER_REQUEST using Node.js?

Currently, I have a DDB table set up with BillingMode: PROVISIONED and ProvisionedThroughput:{...}. My goal is to switch it to BillingMode: PAY_PER_REQUEST, but every time I attempt this change, I encounter the following error: TypeError: Cannot read prop ...

Serverless Framework Express Rest-API encounters a 502 Bad Gateway Error

Currently, I am working on building an express rest-api using the serverless framework with the code provided below. The issue I am facing is that while the POST request method to the path /fruits is functioning properly, the GET request method is resultin ...

Guidelines for managing UnprocessedItems with the AWS JavaScript SDK for dynamoDB

Currently, I'm facing an issue while attempting to utilize an AWS Lambda function for handling events from SendGrid. The event is expected to be in the form of an array containing a variable number of JSON objects, each representing a specific event. ...

How can I use nodejs to export filtered data from dynamodb to a csv file?

I am looking to export specific data from my dynamodb database into a csv file. I have already written a function that filters the data based on name and id criteria. However, I am unsure how to proceed with exporting this filtered data into an Excel doc ...

Using Python's lambda function to extract data from DynamoDB's JSON structure

I'm looking for a Python Lambda function that can handle DynamoDB streams and convert the JSON data from DynamoDB format to standard JSON. PHP and nodejs have Marshaler options for this task, but I'm interested in finding similar or alternative solutions ...

Exploring the DynamoDB List Data Type

Currently, I am working on an angular 8 application where I have chosen to store JSON data in a list data type within DynamoDB. Inserting records and querying the table for data has been smooth sailing so far. However, I have run into some challenges when ...

Utilizing DynamoDB attribute names to transmit JSON data through REST APIs

One issue I have encountered is with a field in my Car POJO class, which appears as follows: @DynamoDBAttribute(attributeName = "release_year") private int year; As I attempt to add a Car object to the database using a POST request through Postman, I ini ...

DynamoDB allows you to set a Time to Live (TTL) for items, displaying the expiration time but not automatically

My setup includes setting ttl as a TTL column and adding epoch time on it for certain items. https://i.stack.imgur.com/LenXa.png However, I noticed that these items are not being deleted. What could be causing this issue? https://i.stack.imgur.com/icEsl ...

Why does the Amazon DynamoDB scan trigger an error by making two HTTP requests to the server?

My TypeScript React application is using DynamoDB services to store data, with a JavaScript middleware handling the database access operations. While developing locally, I successfully implemented the scan, put, and delete operations with no errors. Howeve ...

Steps for accessing data from AWS API Gateway and showcasing it on a static website stored on S3

I am in the process of sending an ajax request to AWS API Gateway to extract data from a JSON and display it on a webpage. The objective is to have a webpage load, trigger an ajax request to API Gateway, which then invokes a lambda function to fetch inform ...

Updating a specific element within a list using AWS DynamoDB

In my DynamoDB database, I have the following table structure: { UserId: "123456", Orders: [ { OrderId: "ORD123", OrderRef: "Christmas presents", OrderStatus: 0, ...

Is it feasible to establish a direct link between an Angular.js application and Dynamodb? Are there any other solutions available to eliminate the need for a backend

Personally, I believe that removing the backend could be a successful strategy for addressing sysadmin/scale issues. Do you agree with this approach? Is there a proven method for eliminating the backend in web applications that require database access? I' ...

Guide on extracting just the key and its value from a Filter expression in a DynamoDB Query using Typescript

Presented here is a filter expression and Key Condition. The specific set of conditions are as follows: {"Age":{"eq":3},"Sex":{"eq":"MALE"}} const params: QueryCommandInput = { TableName: my_tab ...

Updating DynamoDB objects seamlessly in Lambda functions without any conflicts

I am currently working with example Objects that follow this interface structure: interface Car{ id: Number; name: String; tires: Wheel[] } interface Wheel{ id: Number; name: String; radius: Number; } My goal is to store these Car Objects in DynamoDB and ...

Tips for troubleshooting an AWS Lambda function

Over the weekend, I spent time running node functions on AWS Lambda connected to DynamoDB. I used X-ray for debugging, creating my own annotations along the way. I'm curious if there is a more efficient method for debugging lambda functions, such as a ...

What is the best way to retrieve information from this automatically generated AWS Amplify API?

I'm struggling to make a successful query to an automatically generated Amplify API using Postman. Despite seemingly simple, I can't get it to return a JSON object. The data exists in DynamoDB but consistently returns an empty array in Postman along with a ...

How to choose between AWS.DynamoDB and AWS.DynamoDB.DocumentClient for your specific use case?

As I delve into learning DynamoDB and the AWS serverless stack, I've noticed that many tutorials recommend using AWS.DynamoDB.DocumentClient. This is exemplified by the following code snippet used to create an item: const dynamodb = new AWS.DynamoDB.Docum ...

Is my DynamoDb connection closed after every use?

I'm trying to figure out if my Dynamodb connection closes every time I run a command. const dboperation1 = async(param) =>{ const docClient = new AWS.DynamoDB.DocumentClient(); const result = await docClient.query(params).promise(); return r ...