Docs Home → MongoDB Spark Connector
Write to MongoDB
Setting the Write Mode to overwrite
If you specify the
overwrite write mode, the connector drops the target
collection and creates a new collection that uses the
default collection options.
This behavior can affect collections that don't use the default options,
such as the following collection types:
Collections with non-default collations
If your write operation includes a field with a
the connector writes the field name and
null value to MongoDB.