Integrating MongoDB with Spark and Freemarker