Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

433
Views
Con DynamoDB y docClient, ¿es posible obtener valores de retorno al usar transactWrite?

Digamos que estoy haciendo una actualización y una eliminación:

 const transactionParams = { ReturnConsumedCapacity: "INDEXES", TransactItems: [ { Delete: { TableName: reactionTableName, Key: { "SOME_PK_", "SOME_SK_", }, ReturnValues: 'ALL_OLD', }, }, { Update: { TableName: reviewTableName, Key: { PK: "SOME_PK", SK: "SOME_SK" }, ReturnValues: 'ALL_OLD', }, }, ], }; try { const result = await docClient.transactWrite(transactionParams).promise(); } catch (error) { context.done(error, null); }

aunque estoy usando ReturnValues como "ALL_OLD", parece que no puedo acceder a eso. ¿Es esto posible con transactWrite, o debo hacer un get after y comer una lectura?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

¿Ha revisado ItemCollectionMetrics en la respuesta? Los documentos sugieren que es un mapa del nombre de la tabla -> elementos afectados por la consulta

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#API_TransactWriteItems_ResponseElements

over 4 years ago · Santiago Trujillo Report

0

await docClient.transactWrite(transactWriteItemsQueryParam, (err, data) => { if (err) { console.error('Transaction Failed. Error JSON:', JSON.stringify(err, null, 2)); reject(err); } else { console.log('Transaction succeeded:', JSON.stringify(data, null, 2)); //data[0].Items -is result of delete query //data[1].Items -is result of update query resolve(data); } });
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!