File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,9 @@ defmodule ExAws.Dynamo do
483483 keys: [
484484 [api_key: "key1"],
485485 [api_key: "api_key2"]
486- ]
486+ ],
487+ expression_attribute_names: %{"#api_key" => "api_key"},
488+ projection_expression: "#api_key"
487489 ],
488490 "Subscriptions" => %{
489491 keys: [
@@ -503,6 +505,8 @@ defmodule ExAws.Dynamo do
503505 @ type get_item :: [
504506 { :consistent_read , boolean }
505507 | { :keys , [ primary_key ] }
508+ | { :expression_attribute_names , expression_attribute_names_vals }
509+ | { :projection_expression , binary }
506510 ]
507511 @ spec batch_get_item ( % { table_name => get_item } ) :: ExAws.Operation.JSON . t ( )
508512 @ spec batch_get_item ( % { table_name => get_item } , opts :: batch_get_item_opts ) :: ExAws.Operation.JSON . t ( )
@@ -519,7 +523,7 @@ defmodule ExAws.Dynamo do
519523 |> Map . new ( )
520524 |> Map . drop ( @ special_opts ++ [ :keys ] )
521525 |> camelize_keys
522- |> build_expression_attribute_names ( table_query )
526+ |> build_expression_attribute_names ( Map . new ( table_query ) )
523527 |> Map . put ( "Keys" , keys )
524528
525529 Map . put ( query , table_name , dynamized_table_query )
Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ defmodule ExAws.DynamoTest do
186186 "Subscriptions" => % { "Keys" => [ % { id: % { "S" => "id1" } } ] } ,
187187 "Users" => % {
188188 "ConsistentRead" => true ,
189- "Keys" => [ % { api_key: % { "S" => "key1" } } , % { api_key: % { "S" => "api_key2" } } ]
189+ "Keys" => [ % { api_key: % { "S" => "key1" } } , % { api_key: % { "S" => "api_key2" } } ] ,
190+ "ExpressionAttributeNames" => % { "#api_key" => "api_key" , "#id" => "id" } ,
191+ "ProjectionExpression" => "#id, #api_key"
190192 }
191193 }
192194 }
@@ -198,7 +200,9 @@ defmodule ExAws.DynamoTest do
198200 keys: [
199201 [ api_key: "key1" ] ,
200202 [ api_key: "api_key2" ]
201- ]
203+ ] ,
204+ expression_attribute_names: % { "#id" => "id" , "#api_key" => "api_key" } ,
205+ projection_expression: "#id, #api_key"
202206 ] ,
203207 "Subscriptions" => % { keys: [ % { id: "id1" } ] }
204208 } ) . data
You can’t perform that action at this time.
0 commit comments