Thanks, I restarted the system, after that the DB got coneted to the server. not sure what went wrong before.
now I changed the DB connection as
var db = "mongodb://localhost:27017/example";
mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true });`
in shell,
when i use example
it switchd to that database
use collections is empty. why is that? the video tutorial that i followed for learning it says ther were collections created from mongoose chema. but all i see is empty in shell. why,please?
The uri you used earlier is different from what you used now
You are connecting to a mongodb on your local host
Please clarify which is the correct one
Did you meant show collections in the next line?
use collections means it will put you into collections DB
Have you created any collections under example?
If yes you should be able to see with show collections