I’m trying to work with the TIMESTAMP… I’m posting here because I can’t find ANY documentation or examples online or this site. If anybody knows any documentation that would be great!
I’m using MongoDB is a basic CMS, for like blog posts. I’m saving created
and edited
TIMESTAMPS for each post. I have some mongoDB web hook functions that expose these posts to an API, making a headless CMS. The CMS works great, but those timestamps look like:
"created": {
"$timestamp": {
"t": 1631414145,
"i": 5
}
},
"edited": {
"$timestamp": {
"t": 1631414145,
"i": 6
}
},
Questions:
I want to both display these in useful way in the blog post headers and order by them. What is the best way to format this? How do I do it? I think I’d prefer formatting api side, but I’m open to whatever.
I know the ObjectId contains the created date somehow, is it more standard to use that somehow?
I have triggers that format the blog posts… how do I automatically stamp the edited
?
I’m not super opinionated on this, what’s the easiest standard way to work with and format TIMESTAMPs with mongodb?
Thanks for any help!
General question: I always find MongoDB documentation and community very frustrating. Just trying to do basic thing, like format a timestamp, on other platforms I can find examples and documentation in seconds. Why is it so difficult with MongoDB? What am I doing wrong?
Is there a Discord for MongoDB?