Closed Yassineaeh closed 4 years ago
First don’t share your database password Second you wrapped your db name, password between <> . Get rid of them
On Sat, Jun 13, 2020 at 5:06 AM Yassineaeh notifications@github.com wrote:
[image: image] https://user-images.githubusercontent.com/34603692/84554951-406b1e80-ad12-11ea-85d1-7a1d89ee57b7.png ive changed it to mongoAtlas the mongo to connect it via the cloud but it gives me this issue ps : it didnt work with mongodb bec
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/46, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ6E5PWA2UPNIT7KRFLRWLCXRANCNFSM4N4X25ZA .
ive got rid of them but it still gaves me the same error !
Try to connect to your database with this sample code:
const mongoose = require('mongoose'); mongoose.connect('your-connection', {useNewUrlParser: true, useUnifiedTopology: true}); const Cat = mongoose.model('Cat', { name: String }); const kitty = new Cat({ name: 'Zildjian' }); kitty.save().then(() => console.log('meow'));
If it doesn't work, you need to fix your connection.
On Sat, Jun 13, 2020 at 5:09 PM Yassineaeh notifications@github.com wrote:
ive got rid of them but it still gaves me the same error !
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/46#issuecomment-643618141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ2FDVC7OLV76FPMLEDRWNXQ5ANCNFSM4N4X25ZA .
did it fix?
i dont know where to put this code in order to see if it does work ! i want to know if the data you're getting after you install mongo in the tutorial is fetched from the database or the server ? if its the case should i import data.js manually to mongodb in order to fix it ?
to be precise when i downloaded the version : Video-16-Manage-Products-Screen (#14) i couldnt fetch the data from the database !
it's been solved thanks !
glad to hear that.
i dont know where to put this code in order to see if it does work ! i want to know if the data you're getting after you install mongo in the tutorial is fetched from the database or the server ? if its the case should i import data.js manually to mongodb in order to fix it ?
you need to put that code in an empty test.js file and run it like node test.js
to make sure you get no error in console.
ive changed it to mongoAtlas the mongo to connect it via the cloud but it gives me this issue ps : it didnt work with mongodb because i have it already installed but i dont know how to create another database