I have a document -
{\"_id\" : ObjectId(\"51385d2308d427ce306f0100\"), \"aid\" : \"1\", \"studyId\" : \"study-1\", \"mediaType\" : \"mic
you could use mapReduce() where the map() function would contain something like:
// loop all key/value pairs in status without knowing its key
for ( item in this.status ) {
// if value is required: emit the data and break the loop
if ( this.status[item] == "required" ) {
emit( ... )
break;
}
}
does this help ?
Cheers
Ronald