Skip to content

Instantly share code, notes, and snippets.

@saisgit
Created July 25, 2021 16:25
Show Gist options
  • Save saisgit/d0745bbf7e748b810485df238455edd6 to your computer and use it in GitHub Desktop.
Save saisgit/d0745bbf7e748b810485df238455edd6 to your computer and use it in GitHub Desktop.
import com.mongodb.spark._
val database = "sample_mflix"
val collection = "comments"
val movieCommetsDF = (
spark.read
.format("com.mongodb.spark.sql.DefaultSource")
.option("database", database)
.option("collection", collection)
.load()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment