I have a situation where i am trying to use "psuedo" joins where the doc types are ticket and schedule where I want to emit both types of documents.
The schedule document has eventid, year, minute, second and the ticket document has the schedule id.
In the if statement for a schedule doc, I will emit([doc[eventid], doc[year], doc[month], doc[day], doc[scheduleid], name)
In the if statement for a ticket doc, I want to lookup the eventid, year, month, day from the scheduleid in the ticket document. then emit([schedule.event, schedule.year, schedule.month, schedule.day, doc["schedule"], NULL).
I will reduce to get ticket count per event. My question is to handle how to look up a schedule document from within mapblock. I have got "thread exception" error in my first go at this, but before I continue to develop solution I wanted to make sure this is the best solution. Obviously, I can put event, year, month, day in ticket documents but this is redundant information and may lead to errors if I have to change dates of schedule, but I wanted to know if it was a good practice to look up information on another document inside the mapblock on background thread. I realize that the examples are not written in perfect objective c syntax.
I hope I am making myself clear. Please respond.