【问题标题】:Error: option gssapiservicename is not supported错误:不支持选项 gssapiservicename
【发布时间】:2021-12-21 05:06:24
【问题描述】:

mongoose(6.0.12) 抛出错误Error: option gssapiservicename is not supported

这里是设置mongodb连接的代码:

const connectDB = async () => {
try {
    const conn = await mongoose.connect(process.env.MONGO_URI, {
        useUnifiedTopology: true,
        useNewUrlParser: true,
    })

    console.log(`MongoDB Connected: ${conn.connection.host}`.cyan.underline)
} catch (error) {
    console.error(`Error: ${error.message}`.red.underline.bold)
    process.exit(1)
}

}

【问题讨论】:

    标签: node.js mongodb mongoose mern


    【解决方案1】:

    只需删除连接字符串中的参数,较新版本的客户端不再支持此功能

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      • 1970-01-01
      • 2012-07-02
      • 2019-09-02
      • 1970-01-01
      • 2021-10-25
      相关资源
      最近更新 更多