I really need help using C # drivers for SSIS 2013.

I use MongoDB only as an SSIS data source to load data into a SQL Server table, and I’ve been working with the C # driver recently.

Until now, I did not have to meet with the attached documents. Usually in the C # Script task I create a variable and then use it in the cursor:

var query = Query.And(Query.Or(Query.GT("CreatedOn",maxUpdatedOnBSON), Query.GT("UpdatedOn", maxUpdatedOnBSON)), Query.Or(Query.LT("CreatedOn", cutoffDate), Query.LT("UpdatedOn", cutoffDate)),Query.In("TestType", testTypes) ); MongoCursor<BsonDocument> toReturn = collection.Find(query); 

What should I do with the attached documents?

The javascript below works in MongoDB. It selects only documents that meet the criteria in $match , and $unwind allows you to get a separate row for each Items , complete with header elements.

 db.Test.aggregate( [ { $unwind : { path: "$Items",includeArrayIndex: "arrayIndex"} } , { $match: { $and: [ {$or: [ { CreatedOn: { $gt: ISODate("2015-11-22T00:00:00Z")} }, {UpdatedOn: { $gt: ISODate("2015-11-22T00:00:00Z") } } ] }, {$or: [ { CreatedOn: { $lt: ISODate("2016-05-09T00:00:00Z")} }, {UpdatedOn: { $lt: ISODate("2016-05-09T00:00:00Z") } } ] } ] } }] ) 

How to "translate" this code for use in C # task?

    0