No video

How to Query your DynamoDB tables with Serverless

  Рет қаралды 9,665

Complete Coding - Master AWS Serverless

Complete Coding - Master AWS Serverless

Күн бұрын

Learn how to write a use DocumentClient.query to enable you to quickly pull back records with the same type.
github.com/SamWSoftware/Serve...

Пікірлер: 28
@PeteWhelan
@PeteWhelan 4 жыл бұрын
Thanks Sam . Managed to use this to make queries of multiple indexes across multiple tables.
@CompleteCoding
@CompleteCoding 4 жыл бұрын
Great job!
@vinodsamy1725
@vinodsamy1725 3 жыл бұрын
now i'm tempted to watch all your videos. Great thanks:))
@CompleteCoding
@CompleteCoding 3 жыл бұрын
There are a lot of them now. I'd start by looking for the ones that you could use soon.
@shadmanmartinpiyal4057
@shadmanmartinpiyal4057 3 жыл бұрын
Great Video!!
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Glad you enjoyed it
@AmruAshik
@AmruAshik 3 жыл бұрын
thanks alott man!!
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Glad you like it
@rajatmasih3706
@rajatmasih3706 3 жыл бұрын
Good job
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Thanks
@amrmonzir
@amrmonzir 3 жыл бұрын
Thanks for the great video! Can you share what KeyConditionExpression can be used to query a GSI and a sort key? Or is that an invalid operation?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Yes you can! Your params would be something like this, where operation is something like "", "=" const params = { TableName: tableName, IndexName: index, KeyConditionExpression: `${primaryKey} = :primarykey and ${sortKey} ${operation} :sortKey `, ExpressionAttributeValues: { ':primarykey': primaryKeyValue, ':sortkey': sortValue }, }; docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.KeyConditionExpressions
@amrmonzir
@amrmonzir 3 жыл бұрын
@@CompleteCoding thank you so much!
@abnergrajales4225
@abnergrajales4225 3 жыл бұрын
Very good video, one question ... How could dynamodb queries be used to search by latitude and longitude distances? I would appreciate any information. thanks
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Querying on multiple fields at the same time isn't something that is easy in Dynamo. What you can do is query on one field and then use a query filter on the other field to get the final results that you want.
@afiqagaming6290
@afiqagaming6290 3 жыл бұрын
Hi Sam, I am new in serverless. I have a question, If we have set up the database like LSI, GSI in dynamoDB directly, Do we need to set up in yml file also?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
No, you can query a database that you made in the console with serverless. You just need to use the correct table name and it will work the same. Setting it up in Serverless means you could copy everything to another account without having to do anything manually.
@Clemenstigator
@Clemenstigator 3 жыл бұрын
what is the difference in the implementation of global secondary indexes and a local secondary index in serverless?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
local secondary indexes are a very complex topic and there are specific limitations to them. The main one being that you can only create them when you create the table and can't add more in the future. There are also limitations around data size and that you can only query one primary key at once. To implement them in serverless would be very similar to creating a table with global secondary indexes. Just change the "GlobalSecondaryIndexes" in your serverless.yml resources to LocallSecondaryIndexes. The structure should be the same
@vivekgupta1590
@vivekgupta1590 3 жыл бұрын
Hi Sam, I hope you are doing well. I'm trying to make use of the property ScanForwardIndex which is set to false inorder to display the values in descending order. But I guess I'm not setting the property correctly because I keep on getting the error; Serverless Error --------------------------------------- An error occurred: MyDynamoDbTable - Encountered unsupported property ScanIndexForward. My serverless yml looks something like this; Resources: MyDynamoDbTable: Type: AWS::DynamoDB::Table Properties: TableName: ${self:custom.tableName} AttributeDefinitions: - AttributeName: ID AttributeType: S AttributeName AttributeType: S KeySchema: - AttributeName: ID KeyType: HASH BillingMode: PAY_PER_REQUEST GlobalSecondaryIndexes: - IndexName: KeySchema: - AttributeName: KeyType: HASH Projection: ProjectionType: ALL ScanIndexForward: false Any tips on how I can resolve this issue?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
The ScanIndexForward value is used as part of a query request to the database, not on the configuration for the database. If you set it to false then the query response data will be ordered in reverse order. docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-ScanIndexForward
@gunjanmukherjee4076
@gunjanmukherjee4076 3 жыл бұрын
Thank you. How can i update a endpoint after deploy it. For example in place of {filename} i write {ID} and deploy it. when i try convert it into {filename} it is throwing Error.
@CompleteCoding
@CompleteCoding 3 жыл бұрын
What is the error that it's throwing?
@gunjanmukherjee4076
@gunjanmukherjee4076 3 жыл бұрын
@@CompleteCoding A sibling ({ID}) of this resource already has a variable path part -- only one is allowed (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: 146b2a96-0977-436c-9c9f-416357af77e7; Proxy: null).
@bestoos2099
@bestoos2099 4 жыл бұрын
sir please upload a video on authorizers and authentication
@CompleteCoding
@CompleteCoding 4 жыл бұрын
I've had quite a few suggestions to do that so you should see a video on that coming out soon
Securing Your Serverless API With API Keys
14:21
Complete Coding - Master AWS Serverless
Рет қаралды 10 М.
DynamoDB Partitions - How they work - AWS Service Deep Dive
9:29
Complete Coding - Master AWS Serverless
Рет қаралды 9 М.
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 18 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 56 МЛН
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Mini Katana
Рет қаралды 31 МЛН
Create an API to get data from your DynamoDB Database
20:17
Complete Coding - Master AWS Serverless
Рет қаралды 22 М.
What is a DynamoDB GSI (Global Secondary Index) ?
10:19
Be A Better Dev
Рет қаралды 116 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 348 М.
Create a Serverless Database - DynamoDB with the Serverless Framework
9:59
Complete Coding - Master AWS Serverless
Рет қаралды 18 М.
Adding and Getting Files from Amazon S3 with Serverless.
21:39
Complete Coding - Master AWS Serverless
Рет қаралды 14 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 400 М.
AWS DynamoDB Schema Design | How to choose the right key
12:15
Be A Better Dev
Рет қаралды 208 М.
How to Choose Your Multiplayer Backend
27:56
Battery Acid Dev
Рет қаралды 14 М.
Adding New Data to your DynamoDB Database
14:45
Complete Coding - Master AWS Serverless
Рет қаралды 10 М.
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 18 МЛН