I have a view which filters out the data for me. I want to add a check in my search criteria => If a field does not exist in document don't consider that document.
Here is my view code, studentId may not be present in all the documents.
function (doc, meta) {
if(meta.id && meta.id.indexOf("DOCUMENT_") == 0 && doc.studentId != null) {
emit([doc.studentId, doc.studentStatus, doc.studentName], null);
}
}
Any pointers?