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

196
Visualizações
Dynamoose error when calling create

I am using node js and dynamoose to interact with dynamodb. When I try to create a new object Dynamo returns this error. The problem is not with what is coming in on the request, but with dynamoose. The function that is being hit starts at line 5. The error is caused by invoking the function create() on line 6. I have checked the model prototype and it does contain the create function.

'use strict';
  2
  3   const Aircraft = require('../../aircraft.dynamo/index');
  4
  5   function createAircraft(req, res, next) {
  6     Aircraft.create(req.body, (aircraft) => {
  7       return res.status(201).json(aircraft);
  8     });
  9   }
 10
 11   module.exports = createAircraft;

TypeError: Cannot read property 'name' of undefined
            <br> &nbsp; &nbsp;at NewModel.Model.put (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/dynamoose/lib/Model.js:202:72)
            <br> &nbsp; &nbsp;at Function.Model.create (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/dynamoose/lib/Model.js:247:16)
            <br> &nbsp; &nbsp;at Function.NewModel.create (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/dynamoose/lib/Model.js:99:18)
            <br> &nbsp; &nbsp;at createAircraft (/Users/chrisrijos/SideProjects/aircraft-api/server/api/Aircraft/aircraft.controller/createAircraft/index.js:6:14)
            <br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/layer.js:95:5)
            <br> &nbsp; &nbsp;at next (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/route.js:137:13)
            <br> &nbsp; &nbsp;at Route.dispatch (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/route.js:112:3)
            <br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/layer.js:95:5)
            <br> &nbsp; &nbsp;at /Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/index.js:281:22
            <br> &nbsp; &nbsp;at Function.process_params (/Users/chrisrijos/SideProjects/aircraft-api/node_modules/express/lib/router/inde
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