Query a MongoDB collection using Pyspark

I am building an application utilizing PHP with MongoDB as a database.One of collection across DB has massive volume of data i.e 8GB data. I perform aggregate operation on data stored in MongoDB collection and accordingly generate statistics . But processing huge volume of data takes a long duration.Hence I opted for Apache spark to process data stored in MongDB collection I have configured MongoDB spark connector and executed a demo script in python to fetch data from mongo collection through spark.

In above code snippet I have utilized pyspark.sql module to generate RDD. But generation of RDD incurs reading of all data from collection which takes a long duration to read massive volume of data as opposed to principle on which Apache Spark works. Hence suggest me an appropriate solution to read data from Mongo collection using pyspark with optimal performance and also if any alternate package in Apache spark exists to communicate with MongoDB.