awslabs / dynamodb-data-mapper-js

A schema-based data mapper for Amazon DynamoDB.
https://awslabs.github.io/dynamodb-data-mapper-js/
Apache License 2.0
816 stars 106 forks source link

Nested Attributes slash "/.." field name problem - GetItem - ProjectionExpression #195

Open emindeniz99 opened 3 years ago

emindeniz99 commented 3 years ago

Hello,

{  
"name": "Emin",
 "myMap": {
    "/hello": "hi",
    "asd": "123"
  }
}

I want to specify ProjectionExpression to get only "/hello": "hi"

But to specify nested attributes, "."(dot) usage is necessary. ProjectionExpression: "myMap./hello", It is not work. I tried to use escape character "\" in front of "/", it gives error.

error: ProjectionExpression: Syntax error; token: "\", near: ".\/"

code:


const params = {
        TableName: config.aws_table_name,
        Key: {
            name: "Emin",
        },
        ProjectionExpression: "redirects./hello",
    }

    return await docClient.get(params).promise()```