Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

198
Vistas
how to do the update when my key is called key

I have a problem with an update in dynamoDB , when performing the update in dyanamo it tells me that I cannot use the key keyword

"message": "Value provided in ExpressionAttributeNames unused in expressions: keys: {#keyid}", "code": "ValidationException", "time": "2022-05-06T00:24:03.502Z",

When using the ExpressionAttributeNames I must relate the key with a different name "Key" but in the table its id is called key and it generates the previous error when updating this my code.

function updateUser(key, sortkey, dateFiling) {

    try {

        let params = {
            TableName: env.getEnv(CTE.User),
            Key: { "#keyid": key , "sortkey": sortkey },
            UpdateExpression: "set dateFiling = :dateFiling",
            ExpressionAttributeNames: { '#keyid': 'key' },
            ExpressionAttributeValues: { ":dateFiling": dateFiling }
        };

        await db.updateItem(params);

        console.log(params); 
    }

    catch (error) { 

        console.log('Error  in updateUser %j:', error);
   }
}

my doubt is exactly with the ExpressionAttributeNames since it does not take the keyid envelope to refer to the key and not have a problem with the use of the reserved word. Can somebody help me. please

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The Key argument accepts reserved keywords:

Key: { "key": key , "sortkey": sortkey },

Reserved keywords are no-nos in expressions like UpdateExpression. DynamoDB is complaining that you are not using ExpressionAttributeNames in a expression, which is true. Remove it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda