HI How to export timestamp as IST format for CSV

Hari shared this question 4 months ago
Answered

HI How to export timestamp as IST format for CSV

Comments (1)

photo
1

What's IST format?

MongoDB 4.0 has introduced $toDate aggregation which simply convert timestamp to ISO date

db.collection.aggregate([   { "$project": {     "regDate": { "$toDate": "$createTime" }   }} ])
Then export the cursor to ISV format.