For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

MongoDB Connector for Spark

The MongoDB Connector for Spark provides integration between MongoDB and Apache Spark.

With the connector, you have access to all Spark libraries for use with MongoDB datasets: Dataset for analysis with SQL (benefiting from automatic schema inference), streaming, machine learning, and graph APIs. You can also use the connector with the Spark Shell.

The MongoDB Spark Connector is compatible with the following versions of Apache Spark and MongoDB:

MongoDB Spark Connector
Spark Version
MongoDB Version

11.0.1

4.0 or later

4.2 or later