MongoDB – Error: invalid schema, expected mongodb

This is because you are using the connection string in an improper format.

You are using localhost:27017/db/chat while it should be mongodb://localhost:27017/db/chat

The pattern for the connection string is mongodb://<HOSTNAME>:<PORT>/<DBNAME>

Article for reference: https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)