I have couchdb setup to have documents like below
{
"_id": "id",
"_rev": "rev",
"docType": "CLAIM",
"createDate": 1633074806,
"customerClaimNumber": "CCN101",
"claimID": "CLID101"
}
Requirement is to have claims returned (claim id and customerclaim number) based on the createDate between start of day to end of day. CreateDate is epoch timestamp (an integer)
I have written the below view
function (doc) {
if(doc.docType =="CLAIM" && doc.claimDate && doc.customerClaimNumber) {
emit([doc.claimDate], doc.customerClaimNumber, doc.claimID);
}
}
I am looking at the recommendation to achieve search based on the createDate field (integer)