Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Adding an AWSJSON to an empty Map in dynamoDB through appsync-dynamoDB resolver

I am using appsync to store my data to dynamoDB and have 2 tables in dynamoDB. 1 table named Projects storing

ID, data, userID

and another table named UserProjects intending to store userID with all the IDs of the projects that the user owns, this is required as i am looking to implement sharing of projects (just adding the ID of the project to the userID)

However, I am having trouble writing the resolver for appsync- dynamoDB. as I want to add AWSJSON objects to the empty map in dynamoDB

Example at start:

Starting DB, an empty map through this resolver code called

{
    "version" : "2017-02-28",
    "operation" : "UpdateItem",
    "key" : {
        "UserEmail" : { "S" : "${context.arguments.UserEmail}" }
    },
      "update": {
    "expression": "SET #Projects = :emptyMap",
    "expressionNames": {
    "#Projects" : "Projects"
    }, 
    "expressionValues": {
    ":emptyMap" : {"M" : {}}
    }
  },
  "condition": {
    "expression" : "attribute_not_exists(UserEmail)"
  }
}

This is the end result I want, to be able to add one AWSJSON set into "Projects"

I have tried to find stackoverflow but all of the examples are in Java/javascript

and I have tried this but to no avail

{
    "version" : "2017-02-28",
    "operation" : "UpdateItem",
    "key" : {
        "UserEmail" : { "S" : "${context.arguments.UserEmail}" }
    },
    "update" : {
        "expression" : "SET #Projects.#Key = :test",
        "expressionName": {
        "#Projects": "Projects"
        "#Key": "key"
        },
        "expressionValues": {
        ":test" : $util.toJson(${context.arguments.Projects})
        }
    }
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!