Getting timestamp from mongodb id

前端 未结 8 1738
误落风尘
误落风尘 2020-12-02 08:38

How do I get the timestamp from the MongoDB id?

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 09:12

    From the official documentation:

    ObjectId('mongodbIdGoesHere').getTimestamp();
    

提交回复
热议问题