Unable to use IN operator in DynamoDb Querydynamo db error Invalid ProjectionExpression: An expression attribute name used in the document path is not defined; attribute name: #PIs Composite Primary Key in DynamoDB for QueryQuerying DynamoDB without Primary KeyPartition in DynamodbQuerying for DynamoDB items using “contains”DynamoDB query secondary index ValidationException: Condition parameter type does not match schema typeDynamoDB Partition Designbest strategy to query items from dynamodbDynamoDB - simple explanationUsing nested fields in the projection of a DynamoDB GSI
How to derive this identity
How big are the Choedan Kal?
Does Nightpack Ambusher's second ability trigger if I cast spells during the end step?
Why command hierarchy, if the chain of command is standing next to each other?
Are there any other rule mechanics that could grant Thieves' Cant?
Can sampling rate be a floating point number?
Do Reform Jews believe in a theistic God?
Escape Velocity - Won't the orbital path just become larger with higher initial velocity?
Website error: "Walmart can’t use this browser"
Flood on the top floor
Can renaming a method preserve encapsulation?
Why are Tucker and Malcolm not dead?
If "more guns less crime", how do gun advocates explain that the EU has less crime than the US?
Can the IPA represent all languages' tones?
The cat exchanges places with a drawing of the cat
How would timezones work on a planet 100 times the size of our Earth
Should I email my professor about a recommendation letter if he has offered me a job?
Generate Brainfuck for the numbers 1–255
Telephone number in spoken words
A torrent of foreign terms
How far did Gandalf and the Balrog drop from the bridge in Moria?
Corroded Metal vs Magical Armor, should it melt it?
Why does my purified Pokémon need to be healed?
Is this n-speak?
Unable to use IN operator in DynamoDb Query
dynamo db error Invalid ProjectionExpression: An expression attribute name used in the document path is not defined; attribute name: #PIs Composite Primary Key in DynamoDB for QueryQuerying DynamoDB without Primary KeyPartition in DynamodbQuerying for DynamoDB items using “contains”DynamoDB query secondary index ValidationException: Condition parameter type does not match schema typeDynamoDB Partition Designbest strategy to query items from dynamodbDynamoDB - simple explanationUsing nested fields in the projection of a DynamoDB GSI
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
The problem is I am getting error (Filter Expression can only contain non-primary key attributes: Primary key attribute: name).
tenant is my Primary Partition Key and name is my Primary Sort Key.
I need to write something equivalent to this in dynamo db:
Select * from projects where tenant = 'testProject' and name in ('John','Dave').
query =
TableName: 'projects',
ExpressionAttributeNames:
'#tenant': 'tenant',
'#name' : 'name'
,
ExpressionAttributeValues:
":tenant": 'testProject',
":user1" : "John",
":user2" : "Dave"
,
KeyConditionExpression: '#tenant = :tenant',
FilterExpression: '#name IN (:user1,:user2)'
;
amazon-dynamodb dynamodb-queries
add a comment |
The problem is I am getting error (Filter Expression can only contain non-primary key attributes: Primary key attribute: name).
tenant is my Primary Partition Key and name is my Primary Sort Key.
I need to write something equivalent to this in dynamo db:
Select * from projects where tenant = 'testProject' and name in ('John','Dave').
query =
TableName: 'projects',
ExpressionAttributeNames:
'#tenant': 'tenant',
'#name' : 'name'
,
ExpressionAttributeValues:
":tenant": 'testProject',
":user1" : "John",
":user2" : "Dave"
,
KeyConditionExpression: '#tenant = :tenant',
FilterExpression: '#name IN (:user1,:user2)'
;
amazon-dynamodb dynamodb-queries
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
1
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38
add a comment |
The problem is I am getting error (Filter Expression can only contain non-primary key attributes: Primary key attribute: name).
tenant is my Primary Partition Key and name is my Primary Sort Key.
I need to write something equivalent to this in dynamo db:
Select * from projects where tenant = 'testProject' and name in ('John','Dave').
query =
TableName: 'projects',
ExpressionAttributeNames:
'#tenant': 'tenant',
'#name' : 'name'
,
ExpressionAttributeValues:
":tenant": 'testProject',
":user1" : "John",
":user2" : "Dave"
,
KeyConditionExpression: '#tenant = :tenant',
FilterExpression: '#name IN (:user1,:user2)'
;
amazon-dynamodb dynamodb-queries
The problem is I am getting error (Filter Expression can only contain non-primary key attributes: Primary key attribute: name).
tenant is my Primary Partition Key and name is my Primary Sort Key.
I need to write something equivalent to this in dynamo db:
Select * from projects where tenant = 'testProject' and name in ('John','Dave').
query =
TableName: 'projects',
ExpressionAttributeNames:
'#tenant': 'tenant',
'#name' : 'name'
,
ExpressionAttributeValues:
":tenant": 'testProject',
":user1" : "John",
":user2" : "Dave"
,
KeyConditionExpression: '#tenant = :tenant',
FilterExpression: '#name IN (:user1,:user2)'
;
amazon-dynamodb dynamodb-queries
amazon-dynamodb dynamodb-queries
edited Mar 27 at 11:21
Shikher Garg
asked Mar 27 at 10:14
Shikher GargShikher Garg
22 bronze badges
22 bronze badges
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
1
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38
add a comment |
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
1
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
1
1
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38
add a comment |
1 Answer
1
active
oldest
votes
As of the day that I am writing this, you cannot use IN
in your key condition expression, nor can you include a key attribute in your filter expression.
The way to do what you’re wanting to do is with a BatchGetItem
request, which allows you to specify the full primary key for multiple items.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374716%2funable-to-use-in-operator-in-dynamodb-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As of the day that I am writing this, you cannot use IN
in your key condition expression, nor can you include a key attribute in your filter expression.
The way to do what you’re wanting to do is with a BatchGetItem
request, which allows you to specify the full primary key for multiple items.
add a comment |
As of the day that I am writing this, you cannot use IN
in your key condition expression, nor can you include a key attribute in your filter expression.
The way to do what you’re wanting to do is with a BatchGetItem
request, which allows you to specify the full primary key for multiple items.
add a comment |
As of the day that I am writing this, you cannot use IN
in your key condition expression, nor can you include a key attribute in your filter expression.
The way to do what you’re wanting to do is with a BatchGetItem
request, which allows you to specify the full primary key for multiple items.
As of the day that I am writing this, you cannot use IN
in your key condition expression, nor can you include a key attribute in your filter expression.
The way to do what you’re wanting to do is with a BatchGetItem
request, which allows you to specify the full primary key for multiple items.
answered Apr 1 at 4:51
Matthew PopeMatthew Pope
2,8901 gold badge8 silver badges22 bronze badges
2,8901 gold badge8 silver badges22 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374716%2funable-to-use-in-operator-in-dynamodb-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is this a copy of the code used? I see you have backticks on projects in TableName. Is this correct?
– kometen
Mar 27 at 10:29
1
I have corrected it. Now it is the copy of the actual code.
– Shikher Garg
Mar 27 at 10:38