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

208
Views
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 answers
Answer question

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 Report

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 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!