I use myModel.find();
Results:
{
_id : "5afe3beb6fb6b70bfffaff13",
name: "test01",
birthday: "Mon Jun 04 2018 14:56:46 GMT+0700 (+07)",
},
{
_id : "5afe3beb6fb6b70bfffafrr13",
name: "test02",
birthday: "Mon Jun 04 2018 14:56:46 GMT+0700 (+07)",
},
How to convert "birthday" field from ISODate to (Y-m-d) ?
Note:Don't update database
Results wish:
{
_id : "5afe3beb6fb6b70bfffaff13",
name: "test02",
birthday: "2018-06-06",
},
{
_id : "5afe3beb6fb6b70bfffafrr13",
name: "test02",
birthday: "2018-06-06",
},
Thanks for your time!