IllegalArgumentException: requirement failed: Invalid uri

TonyLe
New Contributor

Hi all, 

I'm trying to connect to MongoDB using the Databricks notebook. I keep getting the error that my MongoDB uri is invalid. The uri works when connecting from my local machine using the Rust driver. I pretty much followed the tutorial that was given for MongoDB and Databricks.

Here are the things I've done/tried: 
- Made sure my scala and spark version matches up on the cluster with the Mongo-spark library. 
- Made sure to whitelist the ip of the cluster nodes.

Thank you

Ajay-Pandey
Databricks MVP

Hi @TonyLe ,

Make sure mongoDB library should be installed and please refer below blog for your reference - 

MongoDB | Databricks on AWS

Ajay Kumar Pandey

-werners-
Esteemed Contributor III

Also take in mind firewall issues in case the mongodb is on-prem or on some other location.