DynamoDB FilterExpression not returning correct results with multiple AND operators
up vote
0
down vote
favorite
I have a Lambda function in Nodejs which has DynamoDB query parameters as following with params.FilterExpression
previously set and appended with an AND
operator:
params.FilterExpression = `attribute_exists(#i) AND #i = :i AND $params.FilterExpression`;
params.ExpressionAttributeNames['#i'] = 'ipName';
params.ExpressionAttributeValues[':i'] = 'Test 123';
The query is executed successfully, I get the items but with wrong ipName
, they should have ipName = 'Test 123'
, however I see ipName = 'Test 1200'
inside the items.
amazon-web-services nosql amazon-dynamodb
add a comment |
up vote
0
down vote
favorite
I have a Lambda function in Nodejs which has DynamoDB query parameters as following with params.FilterExpression
previously set and appended with an AND
operator:
params.FilterExpression = `attribute_exists(#i) AND #i = :i AND $params.FilterExpression`;
params.ExpressionAttributeNames['#i'] = 'ipName';
params.ExpressionAttributeValues[':i'] = 'Test 123';
The query is executed successfully, I get the items but with wrong ipName
, they should have ipName = 'Test 123'
, however I see ipName = 'Test 1200'
inside the items.
amazon-web-services nosql amazon-dynamodb
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Lambda function in Nodejs which has DynamoDB query parameters as following with params.FilterExpression
previously set and appended with an AND
operator:
params.FilterExpression = `attribute_exists(#i) AND #i = :i AND $params.FilterExpression`;
params.ExpressionAttributeNames['#i'] = 'ipName';
params.ExpressionAttributeValues[':i'] = 'Test 123';
The query is executed successfully, I get the items but with wrong ipName
, they should have ipName = 'Test 123'
, however I see ipName = 'Test 1200'
inside the items.
amazon-web-services nosql amazon-dynamodb
I have a Lambda function in Nodejs which has DynamoDB query parameters as following with params.FilterExpression
previously set and appended with an AND
operator:
params.FilterExpression = `attribute_exists(#i) AND #i = :i AND $params.FilterExpression`;
params.ExpressionAttributeNames['#i'] = 'ipName';
params.ExpressionAttributeValues[':i'] = 'Test 123';
The query is executed successfully, I get the items but with wrong ipName
, they should have ipName = 'Test 123'
, however I see ipName = 'Test 1200'
inside the items.
amazon-web-services nosql amazon-dynamodb
amazon-web-services nosql amazon-dynamodb
asked yesterday
Faizan Ali
336416
336416
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday
add a comment |
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237337%2fdynamodb-filterexpression-not-returning-correct-results-with-multiple-and-operat%23new-answer', 'question_page');
);
Post as a guest
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
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
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
I'm not a big fan of your self-referential interpolation on params.FilterExpression, but hopefully it's not a problem. What did params.FilterExpression contain prior to the interpolation?
– jarmod
yesterday