How can I call a related model in Mongoose mapreduce
map/reduce operates on one collection at a time. My suggestion would be:
- Map/Reduce over events and emit once for each date including the event ID and the venue ID (hopefully you have the venue Id in the events collection)
- Query the resulting collection ("occurrences") for all records that have a venue ID, query venues for that document, and then update the "occurrences" document with the denormalized venue information.