Docs Menu

Docs HomeMongoDB 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:

  • Sharded collections

  • Collections with non-default collations

  • Time-series collections


If your write operation includes a field with a null value, the connector writes the field name and null value to MongoDB.

←  Getting StartedRead from MongoDB →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.