How to insert, update and delete Mongodb data in SSIS

Introduction

This article will show examples of inserting, updating, and deleting data in MongoDB using SSIS.

Prerequisites

  • SSIS PowerPack: Download and install the ZappySys SSIS PowerPack from this site.
  • MongoDB database

Steps

  1. Add an SSIS MongoDB ExecuteSQL Task: Drag and drop a SSIS MongoDB ExecuteSQL Task task into your SSIS package.

  2. Create a MongoDB Connection:

    • Set up the host, username, password, and database.
    • Check the other tabs for additional configuration options.
    • Test the connection to ensure it is working.
  3. Check Our Examples: You can check our examples for some commands for MongoDB.

  4. Insert One or More Rows: For this example, we will use this command to insert one row into our collection, then press Test/Preview to see the result.

  5. Update One or More Rows: We will update the inserted row. We will select the fields we want to modify and the ID from the collection.

  6. Remove One or More Rows: Now, we will use the delete command and a conditional for the ID. You can use another condition, like Company Name or other fields.

  7. Use MongoDB Destination: Inside our MongoDB destination, we have these options so you can use them with a source table. You can check our example here with an SQL server source table.

Video Tutorial

Watch a detailed video tutorial on this process:

Conclusion

This tutorial shows examples of inserting, updating, and deleting in MongoDB. If any issues arise, please get in touch with our support via chat on our website.

References