This is the url I got so far:
mongodb+srv://admin:@shumongo-chndu.mongodb.net/dbname/test
but I saw others have mlab.com
instead of 'mongodb.net`. Am I doing something wrong? Or the instruction is somehow outdated?
This is the url I got so far:
mongodb+srv://admin:@shumongo-chndu.mongodb.net/dbname/test
but I saw others have mlab.com
instead of 'mongodb.net`. Am I doing something wrong? Or the instruction is somehow outdated?
hey,
instructions are outdated but donāt worry about different url - you can still continue with challenges.
MLab was acquired by MongoDB.
Thanks @orvalho. I had some difficulties to continue with the url I have. But I will keep trying. At least now I know the url is fine.
Good luck! If you get stuck - ask away.
Hi @orvalho, I am still a little confused:
Hereās the connection string I got:
mongodb+srv:// admin : <password> @shumongo-chndu.mongodb.net/test?retryWrites=true
Why it points to test
? I saw othersā link and they seem to have a user defined names. Do I need to do something more after the mongodb cluster is up and running? For example, create a table inside the instance?
And what is the +srv
part? Do i need to remove it?
you need to:
regarding ātestā and ā+srvā - I have those in all urls of my projects (have not looked into what ātestā and ā+srvā mean - but thatās not the problem)
Hi @orvalho, I managed to connect to the mongodb. The reason I failed before was that the white-list all ips
is not done correctly.
Now I am stuck at the create a model
step : āCannot read property āmodelNameā of undefinedā .
Not sure what to do to fix the code. Could you please take a look at my project? Thank you very much!
congrats on connecting to Database!
you have written a Schema but have not written a Model.
You gonna want to look into Mongoose docs on how to create a Model. Hereās the link:
https://mongoosejs.com/docs/models.html
Hah, tried several things and finally passed this challenge! Thank you @orvalho!
The instruction is kinda vague but now I know the model has to be called āPersonā.