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.
(node:11212) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Я использую Mon goose, но мне нужно перейти к параметрам:
- {useNewUrlParser: true}
- {useUnifiedTopology: true}
но когда я прохожу оба, это выдает ошибку.
C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\connection.js:585
throw new MongooseError('3rd parameter to `mongoose.connect()` or ' + ^Error [MongooseError]: 3rd parameter to `mongoose.connect()` or `mongoose.createConnection()` must be a function, got "object"
at new MongooseError (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\error\mongooseError.js:10:11) at NativeConnection.Connection.openUri (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\connection.js:585:11) at Mongoose.connect (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\index.js:333:15)
at Object.<anonymous> (C:\Users\aA\Desktop\database pro\FruitsProject\app.js:5:10) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { message: '3rd parameter to `mongoose.connect()` or `mongoose.createConnection()` must be a function, got "object"', name: 'MongooseError'}