Closed Fasunle closed 2 years ago
I checked online but the responses I saw couldn't solve the problem.
When I remove the retryWrites=true& w=majority, the connection was successful. But I feel like I have turned the functionality of retryWrites off. This is definitely a bug!
Make sure you don't have any typos in your connection string. Given that you typo-ed in this comment, the most likely explanation is that you have an errant space after true
:
await mongoose.connect('mongodb://localhost:27017/test?retryWrites=true &w=majority'); // Throws "Expected retryWrites to be stringified boolean value, got: true"
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days
This issue was closed because it has been inactive for 19 days since being marked as stale.
version 6.1.3 Do you want to request a feature or report a bug? bug What is the current behavior? MongoParserError: Expected retryWrites to return a stringified Boolean but got true If the current behavior is a bug, please provide the steps to reproduce.
[x] try to connect with the database using the connection string: mongodb+srv://:@sandbox.qnvqb.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
![Uploading server-mongo.png…]()
What is the expected behavior?
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version. node 14.17.6 mongoose 6.1.3 mongodb 4.4.10