title: Not able to Show/Write from spark DF read using mongo spark connector.
body: <p>I am trying to read a huge complex document from MongoDB into spark data frame. When I convert this db to json, It works. But If I directly read from MongoDB I am getting the following error : <strong>Caused by: com.mongodb.spark.exceptions.MongoTypeConversionException: Cannot cast STRING into a DoubleType (value: BsonString{value='NaN'})</strong></p>
  
  <p>Able to read into DF and do all the processing. Getting error when I try to show it or write to a json/csv. </p>
  
  <p>at mongo$.main(mongo.scala:270) – df.show()</p>
  
  <p>Using sbt for Dependencies 
  mongo spark connector: 2.2.1
  Scala Version: 2.11.6 Spark version: 2.3.0/2.2.0</p>