Ketul Patel
Ketul Patel

Reputation: 3

what is 'node:6856' warnig?

This error came up when I tried running server. what should I do?

(node:6856) 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. Server running on port ${port} { MongoNetworkError: failed to connect to server [ds263172.mlab.com:63172] on first connect [MongoNetworkError: connect ETIMEDOUT 54.171.245.223:63172] at Pool. (D:\Learning & Interest\Computer\Web\projects\devconnector\node_modules\mongodb-core\lib\topologies\server.js:564:11) at emitOne (events.js:116:13) at Pool.emit (events.js:211:7) at Connection. (D:\Learning & Interest\Computer\Web\projects\devconnector\node_modules\mongodb-core\lib\connection\pool.js:317:12) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at Socket. (D:\Learning & Interest\Computer\Web\projects\devconnector\node_modules\mongodb-core\lib\connection\connection.js:246:50) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:66:8) at _combinedTickCallback (internal/process/next_tick.js:139:11) at process._tickCallback (internal/process/next_tick.js:181:9) name: 'MongoNetworkError', errorLabels: [ 'TransientTransactionError' ], [Symbol(mongoErrorContextSymbol)]: {} }


Upvotes: 0

Views: 160

Answers (2)

Insane noise
Insane noise

Reputation: 66

As the warning suggests you need to use the updated URL parser

USE this for Reference

Upvotes: 0

TomBombadil
TomBombadil

Reputation: 350

On your MongoClient.connect(...) statement add {useNewParser: true}. Your connect statement should look something like this:

MongoClient.connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true })

Upvotes: 0

Related Questions