Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmehner/mongo-3.6.3-bug
Reproduable example of a bug (?) in the node mongodb client version 3.6.3
https://github.com/rmehner/mongo-3.6.3-bug
Last synced: 23 days ago
JSON representation
Reproduable example of a bug (?) in the node mongodb client version 3.6.3
- Host: GitHub
- URL: https://github.com/rmehner/mongo-3.6.3-bug
- Owner: rmehner
- Created: 2021-01-24T19:09:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-25T09:30:51.000Z (almost 4 years ago)
- Last Synced: 2024-11-09T18:29:10.158Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mongo Client 3.6.3 bug
🐛 https://jira.mongodb.org/browse/NODE-3052
## Requirements
* Node 12+
* npm
* Docker## Steps to reproduce
1. Clone this repo
2. `npm install`
3. `docker-compose up`
4. `node index.js` (or `npm test`)## Expected behaviour
No error and the message: If you see this, the connection was successful 🎉
## Actual behaviour
No output for a while, then:
```
UnhandledPromiseRejectionWarning: MongoServerSelectionError: Server selection timed out after 30000 ms
```## Fixes
### Downgrade to 3.6.2
In `package.json`, change version of `mongodb` to `3.6.2`, run `npm install`.
Everything works as expected then.### Don't use useUnifiedTopology
Change the connection call to:
```js
const client = new MongoClient("mongodb://localhost:27017");
```This also works as expected then.