Description:

This processor runs bulk updates against MongoDB collections. The flowfile content is expected to be a JSON array with bulk write operations as described in the manual for db.collection.bulkWrite.

You can use all (currently 6) operators described there. The flowfile content is returned as-is. You can merge many operations into one - and get massive performance improvements.

Example:

The following is an example flowfile content that does two things: insert a new document, and update all documents where value of hey is greater than zero.

                [
                    {"insertOne": {"document": {"ho": 42}}},
                    {"updateMany": {"filter": {"hey": {"$gt": 0}}, "update": {"$inc": {"hey": 2}}}}
                ]