Hi, i’m following this tutorial to build my first API:
I believe it was some miscommunication by the part of the author, when in this line of code he says we need to connect to this database:
// Require external modules const mongoose = require('mongoose') // Connect to DB mongoose.connect(‘mongodb://localhost/mycargarage’) .then(() => console.log(‘MongoDB connected…’)) .catch(err => console.log(err))
Well, first of all, i don’t have this “mycargarage” db, so how do i set it?
Second, i’m having some connection issues with mongo, when i type mongo on my shell i get an error, which i believe is not related to the tutorial, just some issue with my installation, it says:
Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException:
Already searched through MongoDB documentation it says nothing about the 1st issue nor the 2nd one, even searching through StackOverflow i could figure it out.
How can i solve the first issue? I mean i think i can find if i search more, just saying in case anyone here know an easy fix, no need to bother, the 1st is my biggest concern right now.
In advance, thank you very much!