Venessa Yeh
Nov 1 · 1 min read

Two main obstacles I faced:

  1. Newer version of mongoose (5.0+) and deprecation warnings. To avoid, add the following into your server.js file:
const options = {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false
}
mongoose.connect(dbRoute, options)

2. Best practice using “===” vs “==” led to outputting a “null” value when getting the id for DELETE and UPDATE methods in App.js. Just using parseInt() did not change the string variable to an integer and the conditional statement was unable to match up the different typed “ids.” I had to place it inside another variable:

Before:

deleteFromDb = (idToDelete) => {
parseInt(idToDelete);
.
.
.
};

After:

deleteFromDb = (idToDelete) => {
let deleteId = parseInt(idToDelete);
.
.
.
};

Using my local mongo db, I am able to get the app working perfectly! Still waiting for the fix for connecting to MongoDB Atlas.

    Venessa Yeh

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade