Error `Cannot read property 'commandsTakeWriteConcern' of null` in v4.6.0
See original GitHub issueOn the line
mongoose.connection.db.dropDatabase( done );
We are getting the error
Cannot read property 'commandsTakeWriteConcern' of null
at decorateWithWriteConcern (/redacted/node_modules/mongoose/node_modules/mongodb/lib/db.js:485:36)
at Db.dropDatabase (/redacted/node_modules/mongoose/node_modules/mongodb/lib/db.js:872:3)
at Array.db.dropDatabase (/redacted/src/db/index.js:20:25)
at node_modules/async/lib/async.js:596:38
at _arrayEach (node_modules/async/lib/async.js:85:13)
at Object.async.auto (node_modules/async/lib/async.js:554:9)
at Context.<anonymous> (test/config.js:25:9)
However the version mongoose@4.5.9
works fine.
Thanks in advance
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
Cannot read property 'commandsTakeWriteConcern' of null
This query producing strange behaviour. Sometime it gets executed. But sometime it is giving below error. ==================== ...
Read more >TypeError: Cannot read property 'db' of null - node.js
The error message means that client is null in client.db - have you checked if err has any content? – VLAZ. Jan 1,...
Read more >Cannot read property "username" of null - YelpCamp 2021 ...
In this quick video I will show you how to fix a common bug when working on the YelpCamp project from Colt Steele's...
Read more >MongoDB and Mongoose - test timed out - JavaScript
Everytime I submit the reply page, the tests on the freecodecamp page say 'test timed out'. My bash terminal is showing that there's...
Read more >mongodb @ 3.1.0 .. 3.2.3 - Package Diff
.catch(err => /* no error is thrown for bulk errors */); ... -removed in the MongoDB 4.0 release, and we are choosing to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same issue. I got it working by changing where i had my drop statement to;
Use this instead:
The way we fixed this issue was adding a dropDatabase helper in mongoose that ties in with mongoose’s buffering.