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

Add query related validations #4

Open
wparad opened this issue Feb 15, 2024 · 0 comments
Open

Add query related validations #4

wparad opened this issue Feb 15, 2024 · 0 comments

Comments

@wparad
Copy link
Member

wparad commented Feb 15, 2024

const keyExpressionTokens = parseExpression(originalParams.KeyConditionExpression);
    const filterExpressionTokens = parseExpression(originalParams.FilterExpression);
    const matchingFilterExpressionKey = Object.keys(filterExpressionTokens.keys).some(filterKey => Object.keys(keyExpressionTokens.keys)
    .some(keyKey => originalParams.ExpressionAttributeNames[keyKey] === originalParams.ExpressionAttributeNames[filterKey]));
    
    // TODO: convert this from a error generation to in memory filtering
    if (matchingFilterExpressionKey) {
      throw new DynamoDbError({ title: 'DynamoDB disallows having a FilterExpression contain ', key: matchingFilterExpressionKey, parameters: originalParams }, 'InvalidExpression');
    }
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