How to extract multiple arrays from MongoDB using SSIS

Since MongoDB Source supports only one output you cannot select two different hierarchies as your filter criteria. However solution is easy. You can perform following steps to achieve similar result without fetching data twice with multiple sources. Same steps described below can be applied for JSON Source (read more here)

 

Steps – Extract multiple arrays from MongoDB

  1. Extract data using MongoDB source (Select output mode as Raw Document)
  2. Connect MongoDB Source to Multicast Transform
  3. Connect multi cast output to JSON Parser Transform which will take upstream raw JSON doc and convert to Flat table output just like MongoDB source. On Json Parser specify filter e.g. $.doc.Array1[*]
  4. Connect Json Parser Transform output to desired target e.g. sql server/flat file.
  5. Repeat step #3,4,5 for  as many outputs you need with different filter settings (e.g. $.doc.Array2[*]).

Here is more info about JSON Parser Transform (This is new Transform added in v2.2)

//zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/

Video Tutorial – Step By Step – How to read multiple MongoDB arrays

Below video tutorial demonstrates following things

* How to execute MongoDB Shell commands in SSIS (e.g. create Collection)
* How to read data from multiple arrays from MongoDB document (i.e. Orders, Products)
* Save result into two SQL Server tables

 

Posted in SSIS MongoDB Source and tagged , , , , , , .