I want to filter my data with complex key. my view is like this :
function (doc, meta)
{
if(doc.customerId && doc.docType)
{
var out = {meta:meta.id,id: doc.id, TimeStamp :doc.TimeStamp ,
Title:doc.Title , managerValue:doc.managerValue,scenarioId:doc.scenarioId,
customerId:doc.customerId,loginRelId:doc.loginRelId,userRelId:doc.userRelId,StartDate:doc.StartDate
,endDate:doc.endDate,DoneDate:doc.DoneDate,startDateTime:doc.StartDateTime,startDate:doc.startDate
,endDateTime:doc.endDateTime,ViewState:doc.ViewState,Points:doc.Points
,DataType:doc.DataType,Form:doc.Form,ManagerPhone:doc.ManagerPhone
,Status:doc.Status,ManagerName:doc.ManagerName,Description:doc.Description,IsExpired:doc.IsExpired
,IsArchived:doc.IsArchived,Done:doc.Done,AddPointPermission:doc.AddPointPermission
,Mandetory:doc.Mandetory,IsActive:doc.IsActive,_rev:doc._sync.rev
};
emit([doc.customerId,doc.startDate,doc.endDate], out);
}
}
I have tow field for datetime in of them is startDate and another on is endDate another key is customerId which is fixed . I want to filter my docs which they are between to date and have .I use Nodejs SDK and I write some code like this :
var query = ViewQuery.from('dev_Form', 'test').range(["Customer_dd4ced5b-7ff7-450f-88bd-642d162afbaa", "2017/11/05 00:00", ""], ["Customer_dd4ced5b-7ff7-450f-88bd-642d162afbaa","\ufff0", "2017/11/08 00:00"], false);
myBucket.query(query, function (err, results) {
if (err) console.log(err)
console.log(results);
});
But I can’t filter my Dates.What should I do now? How I should write my query?