DynamoDB Error: “Query key condition not supported”
up vote
1
down vote
favorite
I am querying data from a database in aws dynamodb and experiencing an error message on the KeyConditionExpression.
I am querying for "dominant_temporality" and "dt". These make up my composite partition key - dt is unique for each row and my sort key.
The code I'm running:
var params = {
TableName : "deardiary",
KeyConditionExpression: "#d = :dominant_temporality and dt between :minDate and :maxDate",
ExpressionAttributeNames: {
"#d" : "temporality"
},
ExpressionAttributeValues: { // the query values
":dominant_temporality": {S: "present"},
":minDate": {N: new Date("October 8, 2018").valueOf().toString()},
":maxDate": {N: new Date("October 9, 2018").valueOf().toString()}
}
};
nosql amazon-dynamodb
add a comment |
up vote
1
down vote
favorite
I am querying data from a database in aws dynamodb and experiencing an error message on the KeyConditionExpression.
I am querying for "dominant_temporality" and "dt". These make up my composite partition key - dt is unique for each row and my sort key.
The code I'm running:
var params = {
TableName : "deardiary",
KeyConditionExpression: "#d = :dominant_temporality and dt between :minDate and :maxDate",
ExpressionAttributeNames: {
"#d" : "temporality"
},
ExpressionAttributeValues: { // the query values
":dominant_temporality": {S: "present"},
":minDate": {N: new Date("October 8, 2018").valueOf().toString()},
":maxDate": {N: new Date("October 9, 2018").valueOf().toString()}
}
};
nosql amazon-dynamodb
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
You can't query by sort key inkeyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…
– IftekharDani
yesterday
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am querying data from a database in aws dynamodb and experiencing an error message on the KeyConditionExpression.
I am querying for "dominant_temporality" and "dt". These make up my composite partition key - dt is unique for each row and my sort key.
The code I'm running:
var params = {
TableName : "deardiary",
KeyConditionExpression: "#d = :dominant_temporality and dt between :minDate and :maxDate",
ExpressionAttributeNames: {
"#d" : "temporality"
},
ExpressionAttributeValues: { // the query values
":dominant_temporality": {S: "present"},
":minDate": {N: new Date("October 8, 2018").valueOf().toString()},
":maxDate": {N: new Date("October 9, 2018").valueOf().toString()}
}
};
nosql amazon-dynamodb
I am querying data from a database in aws dynamodb and experiencing an error message on the KeyConditionExpression.
I am querying for "dominant_temporality" and "dt". These make up my composite partition key - dt is unique for each row and my sort key.
The code I'm running:
var params = {
TableName : "deardiary",
KeyConditionExpression: "#d = :dominant_temporality and dt between :minDate and :maxDate",
ExpressionAttributeNames: {
"#d" : "temporality"
},
ExpressionAttributeValues: { // the query values
":dominant_temporality": {S: "present"},
":minDate": {N: new Date("October 8, 2018").valueOf().toString()},
":maxDate": {N: new Date("October 9, 2018").valueOf().toString()}
}
};
nosql amazon-dynamodb
nosql amazon-dynamodb
edited Nov 18 at 17:04
asked Nov 17 at 19:52
Emily Chu
718
718
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
You can't query by sort key inkeyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…
– IftekharDani
yesterday
add a comment |
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
You can't query by sort key inkeyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…
– IftekharDani
yesterday
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
You can't query by sort key in
keyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…– IftekharDani
yesterday
You can't query by sort key in
keyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…– IftekharDani
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Check if you are using BETWEEN on HASH which is not allowed - you can use only EQ for HASH or begins_with for range key.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Check if you are using BETWEEN on HASH which is not allowed - you can use only EQ for HASH or begins_with for range key.
add a comment |
up vote
0
down vote
Check if you are using BETWEEN on HASH which is not allowed - you can use only EQ for HASH or begins_with for range key.
add a comment |
up vote
0
down vote
up vote
0
down vote
Check if you are using BETWEEN on HASH which is not allowed - you can use only EQ for HASH or begins_with for range key.
Check if you are using BETWEEN on HASH which is not allowed - you can use only EQ for HASH or begins_with for range key.
answered yesterday
guzial
6312
6312
add a comment |
add a comment |
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%2f53354971%2fdynamodb-error-query-key-condition-not-supported%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
You need to check what your table partition key and range keys are. Is dt your range key?
– Stu
Nov 17 at 21:37
Yes - it is what I am trying to sort the entries on
– Emily Chu
Nov 17 at 23:22
You can't query by sort key in
keyConditionExpression. Please check my answer here : stackoverflow.com/questions/53167165/…– IftekharDani
yesterday