警告: `useMongoClient`オプションは、mongoose5.xでは不要になりました。削除してください。
Warning Usemongoclient Option Is No Longer Necessary Mongoose 5
シナリオ:ノードはmoogseモジュールを使用してmongodbに接続します。
var mongoose = require('mongoose') // Connect to the new version mongoose.connect('mongodb://127.0.0.1:27017/notes', { useMongoClient: true })
次のエラーを報告してください
D:code-base
odeshiyanlou
ode_2>node 'd:code-base
odeshiyanlou
ode_2
otebook_mongodbapp.js' WARNING: The `useMongoClient` option is no longer necessary in mongoose 5.x, please remove it. at handleUseMongoClient (d:code-base
odeshiyanlou
ode_2
otebook_mongodb
ode_modulesmongooselibconnection.js:616:17) at NativeConnection.Connection.openUri (d:code-base
odeshiyanlou
ode_2
otebook_mongodb
ode_modulesmongooselibconnection.js:480:7) at Mongoose.connect (d:code-base
odeshiyanlou
ode_2
otebook_mongodb
ode_modulesmongooselibindex.js:271:15) at Object. (d:code-base
odeshiyanlou
ode_2
otebook_mongodbapp.js:9:10)
エラー情報と公式文書を確認してください
(node:7116) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
バージョンの更新により、オプションパラメータオブジェクトが変更され、次のOKに変更されました。
mongoose.connect('mongodb://127.0.0.1:27017/notes', { useNewUrlParser: true })