Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

312
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda