Mern Stack Tutorial ("null" enteries)

Hello, when I trying the How To Use MERN Stack: A Complete Guide | MongoDB I ran into having “null” for all my entries.

I believe in the “mern/server/routes/record.js” section’s code all the variables

    name: req.body.person_name,
    position: req.body.person_position,
    level: req.body.person_level,

should be

    name: req.body.name,
    position: req.body.position,
    level: req.body.level,

also for

$set: {
      person_name: req.body.person_name,
      person_position: req.body.person_position,
      person_level: req.body.person_level,
    },

should be

$set: {
      name: req.body.name,
      position: req.body.position,
      level: req.body.level,
    },

for “recordRoutes.route(”/update/:id")" function

Please correct me if I am wrong.

2 Likes

I’m just here to agree—I kept getting null values (other than the _ids) until I made the above change. Thanks for posting this.

1 Like

Nice tutorial…Thanks for posting. MERN stack training in Pune