mean-todo | course repo for Building a MEAN Application | Machine Learning library
kandi X-RAY | mean-todo Summary
kandi X-RAY | mean-todo Summary
This is the course repo for Building a MEAN Application on Treehouse by Huston Hedinger and Ken Howard.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mean-todo
mean-todo Key Features
mean-todo Examples and Code Snippets
Community Discussions
Trending Discussions on mean-todo
QUESTION
I'm working on a Node.js server, connecting to MongoDB and written with TypeScript. When I try to use MongoDB it doesn't create a connection, however when I check the mongo output it does appear to create a connection.
What am I missing in my code to define the connection in Node.js?
My connection string is 'mongodb://localhost:27017'
My connection method:
...ANSWER
Answered 2018-Nov-12 at 20:31Based on what you said about neither error nor success callbacks being called, I think the problem is not only in code here: https://github.com/FrisoDenijs/MEAN-ToDo/blob/master/server/src/db/mongo.db.ts
But also e.g. here: https://github.com/FrisoDenijs/MEAN-ToDo/blob/master/server/src/controllers/to-do.controller.ts
When you run mongo.connect
there should be an option to wait for the promise returned from MongoClient.connect
. So I would change code in mongo.db.ts
to for example sth like this (it depends how you want to handle this promise):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mean-todo
git clone <your-fork>
Follow along with course and hack away
git commit -am "commit some cool changes"
git push origin someCoolBranch pushes changes to your fork. Great for sharing code and asking for comments on commits.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page