teamMembers = []
for member in team:
teamMembers.append({'M' : {
'id' : {'S' : member['id']},
'role' : {'S' : member['role']},
'name' : {'S' : member['name']}
}})
project = {
'id' : {
'S' : data['project']['id']
},
'name' : {
'S' : data['project']['name']
},
'team' : {
'L' : teamMembers
}
}
client.put_item(
TableName = 'projects',
Item = project
)
This code gives me the following error:
[ERROR] TypeError: string indices must be integers
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 36, in lambda_handler
'id' : {'S' : member['id']},
team?