Search code examples
javascriptamazon-dynamodb

Will DynamoDB accept a string literal defined with backticks on separate lines as an UpdateExpression?


I have a lengthy UpdateExpression for my Dynamo update. I'm wondering if it's possible to break it onto separate lines with string literal backticks and it still work?

Before:

UpdateExpression: "Set val1 = x, val2 = y, val3 = z" etc.

Can I break it out to something like

UpdateExpression: `
  Set val1 = x, 
  val2 = y, 
  val3 = z
`

I'm just afraid that all of the \n will cause issues?


Solution

  • Yes this will work without issue.