Hi @PappuSingh
Please format your code in the future ... you have to check if the field exists you can not get the .value
on a field that does not exist
I thought we answered this here
If you just want to check do something like this
if(doc['readyCreatedTime'].empty) {
emit(0);
return;
}
long datenow = new Date().getTime();
long datewas = doc['readyCreatedTime'].value.getMillis();
long days = (datenow - datewas) / 86400000;
emit (days);