I am currently using RoboMongo to insert documents into my MongoDB collection. At times, I also need to make updates as well. My documents have two fields are causing me issues:
createdDate
and updateDate
What I would like to do is provide the current Date and time stamp for when I make changes to the document, or when I insert a new document altogether. Inside RoboMongo, I'm trying to do the following:
{
createdDate: new Date(),
updatedDate: new Date(),
}
I have also tried replacing "new Date()" with "ISODate()" but when I try either option, I get an error from RoboMongo saying that I have a particular error on a particular line (which is where I am trying to call the Date()/ISODate() function.
How do I solve this issue?