Quantcast
Channel: User antpaw - Stack Overflow
Viewing all articles
Browse latest Browse all 35

MongoDB convert BsonTimestamp to Date

$
0
0

Is there an (efficient) way of converting a MongoDB document field of type BsonTimestamp to a Date field. Do I have to create a temporary field to store the Date? Do I have to write a custom JS migration script and loop over every item for this?

from this:

"ts": {"$timestamp": {"t": 1620986905,"i": 1    }  }

to this:

"ts": {"$date": {"$numberLong": "1620986905626"    }  }

Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>