We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码如下 const MongoClient = require('mongodb').MongoClient; const uri = "mongodb+srv://username:[email protected]/test?retryWrites=true&w=majority"; const client = new MongoClient(uri, { useNewUrlParser: true }); client.connect(err => { const collection = client.db("test").collection("devices") .then(db => console.log("DB Connected")) .catch(err => console.log(error)) });
module.exports = { mongodb: client }
怀疑报错的原因是不是MongoDB 现在的url是mongodb+srv开头了,但是Mongolass并不支持新format????
The text was updated successfully, but these errors were encountered:
Mongolass封装的官方 mongodb 库建立连接,不太可能是 Mongolass内部的问题。你再查下~
mongodb
https://github.com/mongolass/mongolass/blob/master/lib/index.js#L42
Sorry, something went wrong.
No branches or pull requests
代码如下
const MongoClient = require('mongodb').MongoClient;
const uri = "mongodb+srv://username:[email protected]/test?retryWrites=true&w=majority";
const client = new MongoClient(uri, { useNewUrlParser: true });
client.connect(err => {
const collection = client.db("test").collection("devices")
.then(db => console.log("DB Connected"))
.catch(err => console.log(error))
});
module.exports = {
mongodb: client
}
怀疑报错的原因是不是MongoDB 现在的url是mongodb+srv开头了,但是Mongolass并不支持新format????
The text was updated successfully, but these errors were encountered: