I have a map function in a mapreduce query where I try to compare a couple of dates.
Lets say that the documents contains a property 'Created' with type ISODate:
{
Created: ISODate("2016-01-01T12:00:00.000+0000")
}
In my map/reduce method, I pass a date through the scope:
{
start: ISODate("2015-01-01T12:00:00.000+0000")
}
and in my map method, I print out the following
function() {
print(this.Created);
print(start);
print(this.Created > start);
}
I'll get the following output in my log:
2016-04-25T16:19:04.921+0200 I - [conn129] ISODate("2016-01-01T12:00:00.000+0000")
2016-04-25T16:19:04.922+0200 I - [conn129] Sat Jan 01 2015 13:00:00 GMT+0100 (Vest-Europa (normaltid))
2016-04-25T16:19:04.922+0200 I - [conn129] false
{
CurrentThing: {
StartDate: ISODate(".....")
},
HistoryOfThings: [
{
StartDate: ISODate("...."),
EndDate: ISODate("....")
},
{
StartDate: ISODate("...."),
EndDate: ISODate("....")
}
]
}