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

Filter Expressions not working #8

Open
wesley-mixtelematics opened this issue Oct 25, 2018 · 0 comments
Open

Filter Expressions not working #8

wesley-mixtelematics opened this issue Oct 25, 2018 · 0 comments

Comments

@wesley-mixtelematics
Copy link

Hi,
Thanks for an awesome bit of code.

I found an issue in the class public static QueryRequest CopyQueryRequest(this QueryRequest queryRequest) in DynamoDBUtil . The variables FilterExpression and ExpressionAttributeValues aren't copied across during the deep copy. I've updated my local copy to the following:

 var copiedRequest = new QueryRequest
            {
                AttributesToGet = queryRequest.AttributesToGet.ToList(), // deep copy
                ConsistentRead = queryRequest.ConsistentRead,
                ExclusiveStartKey = queryRequest.ExclusiveStartKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value), // deep copy
                IndexName = queryRequest.IndexName,
                KeyConditions = queryRequest.KeyConditions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
                ReturnConsumedCapacity = queryRequest.ReturnConsumedCapacity,
                ScanIndexForward = queryRequest.ScanIndexForward,
                Select = queryRequest.Select,
                TableName = queryRequest.TableName,
                FilterExpression = queryRequest.FilterExpression, // <-- was missing
                ExpressionAttributeValues = queryRequest.ExpressionAttributeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) // <-- was missing
            };

and now the code works as expected when wanting to filter query results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant