if (doc.cdapi_doc_level.toLowerCase() === "multipartprogram") {
if (typeof doc.cdapi_document.internalIds.multipartProgramId !== "undefined") {
emit(meta.id, {"programId": doc.cdapi_document.internalIds.programId, "seriesId": doc.cdapi_document.internalIds.seriesId, "seasonId": doc.cdapi_document.internalIds.seasonId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "season") {
if (typeof doc.cdapi_document.internalIds.seasonId !== "undefined") {
emit(meta.id, {"seriesId": doc.cdapi_document.internalIds.seriesId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "contributor") {
if (typeof doc.cdapi_document.contributorId !== "undefined") {
emit(meta.id, null);
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "source") {
if (typeof doc.cdapi_document.sourceId !== "undefined") {
emit(meta.id, null);
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "seriesvariation") {
if (typeof doc.cdapi_document.internalIds.seriesVariationId !== "undefined") {
emit(meta.id, {"seriesId": doc.cdapi_document.internalIds.seriesId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "programvariation") {
if (typeof doc.cdapi_document.internalIds.programVariationId !== "undefined") {
emit(meta.id, {"programId": doc.cdapi_document.internalIds.programId, "seriesId": doc.cdapi_document.internalIds.seriesId, "seasonId": doc.cdapi_document.internalIds.seasonId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "program") {
if (typeof doc.cdapi_document.internalIds.programId !== "undefined") {
emit(meta.id, {"seriesId": doc.cdapi_document.internalIds.seriesId, "seasonId": doc.cdapi_document.internalIds.seasonId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "seasonvariation") {
if (typeof doc.cdapi_document.internalIds.seasonVariationId !== "undefined") {
emit(meta.id, {"seasonId": doc.cdapi_document.internalIds.seasonId, "seriesId": doc.cdapi_document.internalIds.seriesId});
}
}
}
}', 'reduce': '_count
_design/dev_hierarchylevels
'map': 'function (doc, meta) {
if (typeof doc.cdapi_doc_level !== "undefined") {
if (doc.cdapi_doc_level.toLowerCase() === "series") {
if (typeof doc.cdapi_document.internalIds.seriesId !== "undefined") {
emit(meta.id, null);