HI How to export timestamp as IST format for CSV

Hari shared this question 4 years ago
Answered

HI How to export timestamp as IST format for CSV

Replies (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.

Leave a Comment
 
Attach a file