I'm trying to implement an API endpoint that handles PATCH
or PUT
requests, updating the relevant QLDB document with the request payload. I'm trying the following, but it doesn't seem to work:
await driver.executeLambda(async (txn) => {
await txn.execute(
`UPDATE People AS p BY p_id SET ? WHERE p_id = ?`,
requestPayload,
documentId,
);
});
The error I get is:
BadRequestException: Parser Error: at line 1, column 32: Invalid path component, expecting either an IDENTIFIER or STAR, got: QUESTION_MARK with value:
1; Expected identifier for simple path
(I have confirmed that the QLDB statement UPDATE People AS p BY p_id SET p.name = 'John Doe' WHERE p_id = '<document_id>'
, run in the QLDB web console, does in fact work as desired. I've also confirmed that the values of my variables are as I'd expect -- the first is an object and the second is a string.)
Is this kind of updating not supported by the QLDB Node.js driver?