I'm using the mongo-spark connector to connect between spark and MongoDB. and I could not insert data to MongoDB because of spark default save mode is to error if the "table" (collection) exists and the I try this.
MongoSpark.write(centenarians).option("collection", "hundredClub")*.option("mode","append")*.save();
but this is not an effect. how can I solve this problem please help me thanks!
This is error message:
Exception in thread "main" java.lang.UnsupportedOperationException: MongoCollection already exists