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

using Map.containsKey does not use expression attribute #63

Open
f-messner opened this issue Nov 23, 2022 · 1 comment
Open

using Map.containsKey does not use expression attribute #63

f-messner opened this issue Nov 23, 2022 · 1 comment
Assignees
Labels

Comments

@f-messner
Copy link

Hello,

I have DynamoDB entries which hold a F# Map<string,string> called values, with keys following a specific schema (X+GUID, where X is a string with letters and digits AND special characters, namely dots, colons underscores and dashes (. : _ -), and GUID is a regular old guid also containing dashes.

Now when I use this library for a query like:
<@ fun p -> Map.containsKey s p.values @> |> template.PrecomputeConditionalExpr

I run into some problems, since the generated expression looks like this:
attribute_exists ( #ATTR6.xxx:xxx.xxx:xx.xxx:x.xx_xxxx-xx+xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx-xxxxxxxx)
that is, values is replaced with a expression attribute (I think that is the right DynamoDB term? Sorry, somewhat new to AWS), but my Map key is not.

Printing out the .Names of this ConditionExpression as well I can see that ATTR6 is mapped correctly [(#ATTR6, values)]

The issue here is that the expression contains illegal characters (running the query fails at the first : but I guess the dots would also do it) and I assume would need to use a expression attribute as well?

Is this something I can fix with correct usage of the library, a bug/oversight in the library, or something that cannot be supported?

Cheers!

@samritchie samritchie added the bug label Nov 25, 2022
@samritchie
Copy link
Collaborator

This is probably a bug - I'll need to dig in to what it should be doing there.

@samritchie samritchie self-assigned this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants