question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please update docs for createConnection

See original GitHub issue

Mongoose was hanging on every single request to my database. After too many hours of frustration, it turns out that the answer at Stackoverflow clarifies what the docs don’t.

I was using createConnection when I should have used connect.

There are many more questions around with exactly the same problem. I only wish that:

  • the docs were clear about this
  • there was some sort of error when connect/createConnection are not used appropriately. Mongoose doesn’t throw error, doesn’t say anything. It just HANGS! I’ve tried with promises, callbacks and everything else I know with the frustration of knowing there was something with Mongoose I couldn’t debug

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:5

github_iconTop GitHub Comments

1reaction
cortopycommented, Aug 22, 2016

@Jeff-Lewis My config is pretty basic.

To connect now:

mongoose.connect(connectionString)
  .then(() => logger.info("Successfully connected to MongoDB. Starting web server..."))
  .catch(err => logger.error("Unable to connect to MongoDB: ", err))
  .then(() => server.start())
  .then(() => logger.info("Successfully started web server. Waiting for incoming connections..."))
  .catch((err) => logger.error(err));

And the model

mongoose.Promise = require("bluebird");
0reactions
vkarpov15commented, Oct 1, 2016

Please clarify what you mean by “not working”

Read more comments on GitHub >

github_iconTop Results From Across the Web

CreateConnection - Amazon EventBridge - AWS Documentation
Creates a connection. A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.
Read more >
Mongoose v5.13.15: Deprecation Warnings
When you enable useUnifiedTopology , please remove those options from your mongoose.connect() or createConnection() calls. If you find any unexpected behavior, ...
Read more >
Unable to recreate Private Service Access on GCP
Here's the error: Cannot modify reserved ranges in CreateConnection. Please use UpdateConnection. Google Cloud Collective. google- ...
Read more >
Connection references in solutions - Power Apps
When connection references are updated, an info banner will be shown that links to a panel containing asynchronous update details. There is also ......
Read more >
mongoose - npm
If your pull requests makes documentation changes, please do not modify any ... Both connect and createConnection take a mongodb:// URI, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found