How to Convert mongodb ISODate to string in mongoDB?

前端 未结 4 1335
悲哀的现实
悲哀的现实 2021-01-12 15:02

I have my ISODate in mongo as ISODate and I want to just that in string format with a specific datetime format.

Here is the ISODate:

ISODate(\"20         


        
4条回答
  •  死守一世寂寞
    2021-01-12 15:07

    I got the expected result while i was trying the following.

    ISODate("2020-04-24T11:41:47.280Z").toJSON()
    

    This will give me back the string

    "2020-04-24T11:41:47.280Z"
    

提交回复
热议问题