comparing dates in mongodb
问题 A Meteor server code updates a Mongodb collection, dateField has value looking like this ISODate("2016-11-19T00:00:00Z") The client selects a dateStart and dateFinish , look like this $('input[name="startDateStr"]').val() // => "2016-11-19" So I convert the user entry so that I can use it to get the documents with the dateField matching the below mongodb query; dateToISO: (date) => { // date format in YYYY-MM-DD const dArr = date.split('-'); return new Date(parseInt(dArr[0]), parseInt(dArr[1]