Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
Dynamo DB - Find the most recent entry for each primary key

I have a dynamoDB table where I have a primary key of "email" and a sort key of "timestamp" For audit purposes I dont have any editing or deletion, only insert. However what I now want is a query to select all users (emails) but only the most recent version of that primary key. Is this possible? I have tried to loop over every email and run a query to select based on primary key and limiting to 1 however my lambda quickly timed out and failed.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to issue n-many queries for n-many PKs, given your data model.

You can create a GSI and have a new attribute Latest as its PK and the ID as the SK and do a query against that and retrieve everything with one Query.

Make it a sparse index so you only populate Latest with a value if it is the latest.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda