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

212
Visualizações
How to get dynamodb to only return certain columns

enter image description here

Hello, I have a simple dynamodb table here filled with placeholder values.

How would i go about retrieving only sort_number, current_balance and side with a query/scan?

I'm using python and boto3, however, just stating what to configure for each of the expressions and parameters is also enough.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Within the Boto3 SDK you can use:

  • get_item if you're trying to retrieve a specific value
  • query, if you're trying to get values from a single partition (the hash key).
  • scan if you're trying to retrieve values from across multiple parititions.

Each of these have a parameter named ProjectionExpression, using this parameter provides the following functionality

A string that identifies one or more attributes to retrieve from the specified table or index. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

]You would specify the attributes that you want to retrieve comma separated, be aware that this does not reduce the cost of RCU that is applied for performing the interaction.

over 4 years ago · Santiago Trujillo Relatório

0

   table = dynamodb.Table('tablename')
   response = table.scan(
        AttributesToGet=['id']

        )

This works. but this method is deprecated, using Projections is recommended

over 4 years ago · Santiago Trujillo 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