Closed iDVB closed 6 years ago
ProjectionExpression
is not a parameter for PutItem
requests; it is being ignored by DynamoDB. It only makes sense in the context of a read operation, and this is a write operation.
Seems to work perfect when I remove the expressionAttributeName and set the ProjectionExpression = “title”
? But then how do I get it to work if I have more then one attribute that is of a reserved words?
I know what I’m trying to do, but new to DynamoDb and of course Dynogels.
It "works perfect" because ProjectionExpression
is being ignored. ProjectionExpression
is used to transform records being fetched from the database.
You are using createAsync
, which maps to a DynamoDB PutItem
request. This is a write operation. PutItem
does not understand ProjectionExpression
because it makes no sense in the context of a write operation.
What are you actually trying to accomplish with ProjectionExpression
?
Sorry, I thought I was getting Dynamo error with using a reserved word for attribute ("title"). AWS docs said to do this to resolve... http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html which is what I was trying to do.
Looks like it was never a problem with the above code. I removed all the expression logic and as you said it had no effect. Now it just works. :P Might have been another issues at the time.
I took a 25hr DynamoDB course with acloud.guru and it never really covered expressions. Thanks for rubber ducking it with me though. Much appreciated.
Dynogels should automatically handle reserved words. If it does not, this would be a bug.
Can't seem to use expressions to ensure I can use reserved word for Attribute. ("title") As in the AWS example: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html
But not sure if I'm doing it wrong, if
dynogels
doesnt support this... or ifdynogels-promisified
doesn't support it.I just keep getting