I want to find a document using the date field contained in the collection
//Document Exemple: MODEL : MY_EVENT
event_time_produce: '2018-01-03T11:00:00.201Z',
event_name : 'show'
I would like to find all the documents starting with '2018-01-03T11:00:'
I want to ignore the part of Millesecobde & ISOtype ..etc
Like in SQL :
SELECT * from MY_EVENT where event_time_produce LIKE '2018-01-03T11:00:%'
I have tried this but not working ( Mongoose)
MY_EVENT.find({event_time_produce : {
$regex: new RegExp('^2018-01-03T11:00:00.*$')
}})
.exec(....)
Simple search work :
MY_EVENT.find({event_time_produce : '2018-01-03T11:00:00.201Z'})
.exec(....)
but I want to get all the documents from 03 Janury 2018 at 11:00:XX
no matter the second just verify the date, hours & minute.