Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDB scan and DynamoDB.DocumentClient scan return different results #3299

Closed
3 tasks done
zachary-D opened this issue Jun 9, 2020 · 6 comments
Closed
3 tasks done
Labels
bug This issue is a bug. closed-for-staleness response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@zachary-D
Copy link

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
Scans with DynamoDB.DocumentClient don't return any values, while scans with identical parameters on DynamoDB return the proper items.

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
Yes

Details of the browser/Node.js version
serverless framework / AWS lambda, nodejs12.x runtime

SDK version number
v2.689.0

To Reproduce (observed behavior)

const dbDoc = new DynamoDB.DocumentClient({apiVersion: "2012-08-10"});
const db = new DynamoDB({apiVersion: "2012-08-10"});

const filter: DynamoDB.DocumentClient.ScanInput = {
    TableName: "locations-table-here",
    FilterExpression: `LHash = :hash`,
    ExpressionAttributeValues: {
        ":hash": {"S": escapeSpecialCharactersForDynamoDB(hash)}
    }
};

console.log(await dbDoc.scan(filter).promise());
console.log(await db.scan(filter).promise());

Expected behavior
Both scans should return the same items, with the different formatting intended for each. As shown in the screenshot, the doc-scan returns no items.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
Similar to #1187, if not the same issue

@zachary-D zachary-D added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2020
@ajredniwja
Copy link
Contributor

Hey @zachary-D, thank-you for reaching out to us with your issue, is there an actual test case that you can provide me?

I scanned a table with around 11000 items and got the same result for the both.

@ajredniwja ajredniwja added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 10, 2020
@zachary-D
Copy link
Author

I should be able to, what exactly do you need from me?

@ajredniwja
Copy link
Contributor

Is it possible for you to create a sample repo to get the same results?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 11, 2020
@ajredniwja ajredniwja added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 11, 2020
@RossWilliams
Copy link

Your expression attribute values for document client should be a different shape, since document client handles marshalling and un-marshalling for you. You are filtering on a map rather than a string, and not getting any results.

When using the document client change ':hash' value to a string, rather than the object you currently have.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 15, 2020
@zachary-D
Copy link
Author

I'll give that a try, thanks!

@ajredniwja ajredniwja added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 17, 2020
@github-actions
Copy link

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants