I have two unix timestamps, a start time (startDate) and an end time (endDate). Using the moment function below gives me the very start/end of the day:
search = {
"end": { "$lte": moment(endDate).startOf('day').unix() },
"start": {"$gte": moment(startDate).startOf('day').unix() }
};
I then pass my search into my buildfire function:
buildfire.publicData.search(search ,'routes', (err, res) => {})
My res is an array of objects, each has a data property with a start and end property inside of that:
res = [
{
data: {
end: 1503554370297,
start: 1503554368711
}
}
]
All results are returning, nothing is being filtered.