rest-hapi icon indicating copy to clipboard operation
rest-hapi copied to clipboard

error when mongodb uri with mongodb+srv

Open karabaralex opened this issue 5 years ago • 0 comments

steps to repro:

  1. create a mongodb cluster at Atlas
  2. get connection uri which looks like mongodb+srv://.mongodb.net/test?retryWrites=true
  3. add this uri to rest-hapi config
      mongo: {
        URI: 'mongodb+srv://<some>.mongodb.net/test?retryWrites=true',
      },
  1. npm start
UnhandledPromiseRejectionWarning: Error: Invalid mongodb uri "mongodb+srv://<name>mongodb.net/test?retryWrites=true". Must begin with "mongodb://"
    at muri (/node_modules/muri/lib/index.js:28:11)
    at NativeConnection.Connection._handleOpenArgs (/node_modules/mongoose/lib/connection.js:199:16)

karabaralex avatar Mar 07 '19 00:03 karabaralex