Questions tagged [documentclient]

The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values

The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values

45 questions
1
vote
2 answers

PartitionKey value must be supplied for this operation in CosmosDB delete operation using DocumentClient

I am trying to delete an item from a container of Cosmos DB database from azure function. But I am getting this error PartitionKey value must be supplied for this operation. I also investigated this but didn't get any luck from there. Below is my…
pcghose
  • 179
  • 16
1
vote
1 answer

UpdateExpression: Add other attribute's value to list

Given the following DynamoDB document: { "myobject" : {"foo" : "bar"}, "mylist" : [{"some" : "stuff}] } My goal is to update this document to get the following result: { "myobject" : {"foo" : "bar"}, "mylist" : [{"some" : "stuff},…
1
vote
1 answer

How would I rewrite this query using the DynamoDB DocumentClient?

I am testing queries in the console and would like to implement them in my code. I was curious how to get this one in my Node.js code. I think it has something to do with QueryFilter but I am struggling to get it. let params = { TableName:…
Matthew Spahr
  • 207
  • 2
  • 11
1
vote
0 answers

Query params with DynamoDB Doc Client

I am trying to write params for my DynamoDB Query. I am getting an error and I believe it is from this query. let params = { TableName: tableName, KeyConditionExpression: '(TimeId = :timeId AND begins_with ( TypeKey , :typeKey)) AND…
1
vote
1 answer

How to sort asc by created date in dynamodb with documentClient

I just want to ask you, how can I receive the newest items sorted by ASC by created date. const getItems = async (limit) => { const params = { TableName, KeyConditionExpression: '#field = :value', ExpressionAttributeNames: { …
1
vote
1 answer

ItemCollectionMetrics is empty after successful transactWrite using DynamoDB.DocumentClient

I am executing a transactWrite (https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#transactWrite-property) instruction to DynamoDb and expecting to get back ItemCollectionMetrics (I am specifying…
1
vote
0 answers

AWS DynamoDB | Check if List of Maps contains a specific value

Im storing user data in AWS DynamoDB. One of the attributes is a List of Maps: skills: [ { name: 'foo' }, { name: 'bar' } ] How can I write a Scan that checks if skills have a map with name = foo? I'm using DocumentClient I…
Vingtoft
  • 13,368
  • 23
  • 86
  • 135
1
vote
0 answers

ConditionExpression failing when attempting to compare range key with supplied date range

I have a table inside dynamodb with a hash key of deviceKey and a range key of timestamp. deviceKeys have the form of 'randomstring-num' so for example I might have 'abc-1', where the string is an IoT device id, and the number is an event sequence.…
1
vote
2 answers

AWS Lambda with DynamoDb no results

I am just starting with AWS and can't get the DynamoDB running at all. I followed a tutorial and created all AWS elements and set priviledge for the DynamoDB in the lambda basic profile. I am wondering why I do not get any results from the DB or any…
1
vote
3 answers

Azure cosmos db issues with connection by resource token

I'm trying to connect to my cosmos db database by using a Resource token instead of a account master key which I used before. Before I used the following way to create DocumentClient: var client = new DocumentClient(new Uri(configAccountName),…
dododo
  • 3,872
  • 1
  • 14
  • 37
0
votes
3 answers

AWS SDK v3 GetCommand API fails to find an item in DynamoDB database

I have a Node.js Lambda function that uses AWS DocumentClient to find an item by primary key in a DynamoDB table. This worked fine in AWS SDK v2 and returned the item data. The item does exist in the database. var params = { TableName :…
0
votes
1 answer

What documentclient.query will return if it cannot find the data based on the ExpressionAttributeValues given?

I am new to AWS and improving a query as below which is a dynamodb table query that will perform search based on the id provided. My question is what the document.query will return if it cannot find the data based on one of the ids array…
0
votes
2 answers

AWS Amplify DataStore time to sync new item to backend so it is accessible in a Lambda function?

my problem: I am busy developing a Vue web app using Amplify DataStore. In the web app, when I save a new Item to the DataStore I am unable to immediately access that item using a Lambda function and AWS.DynamoDB.DocumentClient() to query the…
0
votes
0 answers

Limit is not working for AWS Lambda function

I have a lambda function to fetch the items from dynamoDB. I have already set Limit: 100 but its not working and it gives the response as 413 - Payload Too Large. Here is my code and I am using it with documentClient.query: { TableName:…
0
votes
1 answer

DynamoDB DocumentClient GET all items that match a selection of values

I am playing around with AWS CDK, and so far have implemented API Gateway, with Lambda functions pointing to a DynamoDB. So far, my POST/GET basic lambda functions do as they should, as it is fairly simple. However, I am now stuck on a problem as I…
johnny_mac
  • 1,801
  • 3
  • 20
  • 48