Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAkshit Jindal
1,341 PointsFailed Mongodb Connection?
I am doing the same thing as done in the vedio but i am getting failed mongodb connection.
database.js
'use strict';
var mongoose=require('mongoose');
mongoose.connect('mongodb://localhost/mean-todo',{useMongoClient:true},function(err){ if(err) { console.log('Failed mongodb conection!'); } else { console.log('Successful mongodb conection!'); } });
Akshit Jindal
1,341 PointsEven after using this solution, error is coming.
Alexander La Bianca
15,959 PointsAre you starting the mongodb server with mongod in a seperate terminal window/tab?
Alexander La Bianca
15,959 PointsAlexander La Bianca
15,959 PointsHave you tried to do:
Or use your approach with the callback, but you may need to provide the port number which is 27017 (default)