Hello,
i have problem with my views. View 1 work's fine, geting parent document by
_id, but in View 2 by include_docs=true not get parent document requested by
'_id': XXX.
# View 1
function(doc) {
for (var idx in doc.studyList) {
if (doc.studyList[idx].focusId!="" && doc.studyList[idx].focusId!=null) {
var pole = doc.studyList[idx].focusId.split(/[ -]+/);
for (var i=0; i<pole.length;i++) {
emit([pole[i], doc.parentId], {'_id': doc.parentId});
}
}
}
}
_design/fields/_view/focusIdtest?include_docs=true
{"id":"7L000","key":["1002",0],"value":{"_id":0},"doc":null},
{"id":"13430","key":["1002","13000"],"value":{"_id":"13000"},"doc":{"_id":"13000","_rev"
...
# View 2
function(doc) {
for (var idx in doc.studyList) {
if (doc.studyList[idx].focusId!="" && doc.studyList[idx].focusId!=null) {
var pole = doc.studyList[idx].focusId.split(/[ -]+/);
for (var i=0; i<pole.length;i++) {
emit([pole[i]], [doc.parentId, {'_id': doc.parentId}]);
}
}
}
}
_design/fields/_view/focusIdtest2?include_docs=true
{"id":"13430","key":["1002"],"value":["13000",{"_id":"13000"}],"doc":{"_id":"13430"
...
Can help how make work View2?
I can use array in value but doesn't work in this example.
Thanks all to help.
Ladislav