I am using MongoDB Atlas as my database.
I am using angular4 with loopback as api.
My application connects to my database fine. However, when I try to get data,
I had the same error myself.
If you are using v.3.0 of the MongoDB NodeJS driver refer to MikaS post for the MongoClient.connect changes that need to be made. https://stackoverflow.com/a/47662979/8775223
To connect your application to Atlas MongoDB use the 3.4 driver eg.
mongodb://:@cluster0-shard-00-00-
rb899.mongodb.net:27017,cluster0-shard-00-01-
rb899.mongodb.net:27017,cluster0-shard-00-02-
rb899.mongodb.net:27017/?ssl=true&replicaSet=Cluster0-shard-
0&authSource=admin