fsprojects / fsprojects/FSharp.AWS.DynamoDB

using Map.containsKey does not use expression attribute

Open
#63 1 comment 0 reactions 1 assignee View on GitHub

@samritchie is already working on this.

Since Nov 25, 2022.

bug
Dominant language
F#
Stars
61
Forks
18
Avg merge
7h 27m
Merged PRs (30d)
1

Description

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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.