我正在使用sam这样定义一个dynamodb表:
#DynamoTables
DevicesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: devices
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
-
AttributeName: "customerId"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
-
AttributeName: "customerId"
KeyType: "RANGE"
GlobalSecondaryIndexes:
-
IndexName: "customers"
KeySchema:
-
AttributeName: "customerId"
KeyType: "HASH"
Projection:
ProjectionType: "ALL"
ProvisionedThroughput:
ReadCapacityUnits: "5"
WriteCapacityUnits: "5"
ProvisionedThroughput:
ReadCapacityUnits: "5"
WriteCapacityUnits: "5"
Run Code Online (Sandbox Code Playgroud)
我能够访问使用具有lambda函数表Properties: Policies: AmazonDynamoDBFullAccess的SAM和使用规定看跌PARAMS定义TableName: 'devices'中node。但是,当我尝试通过在索引上定义查询来查询索引时:
params = {
TableName: 'devices',
IndexName: 'customers'
// ...
}
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息,指出 lambda 函数无权访问该索引: …
如何使用云形成模板向lambda函数事件添加(路径)参数?
奇怪地使用:
DeleteItem:
Type: Api
Properties:
Path: /item/{id}
Method: delete
Request:
Parameters:
Paths:
id: true
Run Code Online (Sandbox Code Playgroud)
使用aws-sam-cli工作。但是,当我尝试使用云形成进行部署时,它说未定义属性Request。我从无服务器文档中得到了这个请求的想法,但似乎只能在本地工作。我在模板中找不到有关如何执行此操作的文档,因此将不胜感激任何帮助。
我有表格,我想添加一个功能,该功能将由向下箭头触发并导致选择下一行。因此,我想在任何地方使用向下箭头来触发组件中的功能。我不关心我知道如何在函数中进行选择的选择,那只是我的特定用例。我只是想知道当用户在组件或页面上的任何地方使用向下箭头时如何运行功能?
我看到了如何在输入上执行此操作,但是可以将其绑定到页面或组件上,以便按下表附近的键会触发事件吗?
我想将数字输入的输入绑定到我的打字稿文件中的变量。我认为 ngModel 是合适的,并输入了一个输入:<input [{ngModel}]="tRating" type="number" min="1" max="10">tRating 的类型为 .ts 文件中的数字。不幸的是我收到一个错误:
Can't bind to '{ngModel}' since it isn't a known property of 'input'. ("
<input [ERROR ->][{ngModel}]="pRating" type="number" min="1" max="10">
Run Code Online (Sandbox Code Playgroud) 如果我有一个观察到的student: Observable<Student>,其中Student有参数name: string设置为Jim,如何更改的值name在students观察到的是Bob?
编辑:
是student.map(student => student.name = 'Bob')应该的工作。因为如果是,那么我的程序还有其他问题。