Home:ALL Converter>How to compare two fields from different MongoDB Collections

How to compare two fields from different MongoDB Collections

Ask Time:2014-11-15T09:49:29         Author:lukehf2010

Json Formatter

I am trying to write a query to compare fields in two different MongoDB collections (same DB). Specifically, I have two collections that each contain a field that will match a portion of the time. I would, therefore, like to iterate through each row of each collection performing a comparison. When a match is found, I want to be able to perform a follow-on action (insert value of third field into one of the collections). A suggestion of syntax for this comparison query would be very helpful.

Thank you.

Author:lukehf2010,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/26941639/how-to-compare-two-fields-from-different-mongodb-collections
yy