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
@PeteWhelan4 жыл бұрын
Thanks Sam . Managed to use this to make queries of multiple indexes across multiple tables.
@CompleteCoding4 жыл бұрын
Great job!
@vinodsamy17253 жыл бұрын
now i'm tempted to watch all your videos. Great thanks:))
@CompleteCoding3 жыл бұрын
There are a lot of them now. I'd start by looking for the ones that you could use soon.
@shadmanmartinpiyal40573 жыл бұрын
Great Video!!
@CompleteCoding3 жыл бұрын
Glad you enjoyed it
@AmruAshik3 жыл бұрын
thanks alott man!!
@CompleteCoding3 жыл бұрын
Glad you like it
@rajatmasih37063 жыл бұрын
Good job
@CompleteCoding3 жыл бұрын
Thanks
@amrmonzir3 жыл бұрын
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?
@CompleteCoding3 жыл бұрын
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
@amrmonzir3 жыл бұрын
@@CompleteCoding thank you so much!
@abnergrajales42253 жыл бұрын
Very good video, one question ... How could dynamodb queries be used to search by latitude and longitude distances? I would appreciate any information. thanks
@CompleteCoding3 жыл бұрын
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.
@afiqagaming62903 жыл бұрын
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?
@CompleteCoding3 жыл бұрын
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.
@Clemenstigator3 жыл бұрын
what is the difference in the implementation of global secondary indexes and a local secondary index in serverless?
@CompleteCoding3 жыл бұрын
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
@vivekgupta15903 жыл бұрын
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?
@CompleteCoding3 жыл бұрын
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
@gunjanmukherjee40763 жыл бұрын
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.
@CompleteCoding3 жыл бұрын
What is the error that it's throwing?
@gunjanmukherjee40763 жыл бұрын
@@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).
@bestoos20994 жыл бұрын
sir please upload a video on authorizers and authentication
@CompleteCoding4 жыл бұрын
I've had quite a few suggestions to do that so you should see a video on that coming out soon