ccorbin_pwc
7 years agoNew Contributor
MongoDB Update Query Expression
I have a child pipeline, which contains a MongoDB Update Snap, and I am trying to have the Update Query be an expression so I can take into account parameters passed down to the child pipeline.
The documents in the MongoDB Collection I am targeting, have a unique index on a field named “runId”, and so I am trying to match on this, and where found update another value in the document “documentsExpected”, again from another parameter. Below is what I tried as my expression, but it is choking.
Is what I am attempting possible? If so, where am I going wrong with the expression?
“{ _runId:” + _parentRunId + “}, { $set: { documentsExpected:” + _documentCount + " } }"