I would like to compare two jsons, but I have a problem with dates and objects. I do not know how I can convert them or compare them between two jsons to see if they are the same or not.
JSON 1:
{
"_id" : ObjectId("85f84214452251fec9ac18"),
"tarea" : {
"fechaInicio" : ISODate("2017-09-30T00:00:00.000Z"),
"fechaFin" : ISODate("2017-09-50T00:00:00.000Z"),
"descripcion" : "texto",
}
}
JSON 2:
{
"_id" : ObjectId("99f9992251fec9999"),
"tarea" : {
"fechaInicio" : ISODate("2017-08-22T00:00:00.000Z"),
"fechaFin" : ISODate("2017-08-25T00:00:00.000Z"),
"descripcion" : "texto",
}
}
This is a small example, as you see the _id and the dates are different, but I do not know how to convert them so that they can be compared ... How can I compare the ISODate attributes and the ObjectId?