📜  mongoose objectid 到字符串 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:23.650000             🧑  作者: Mango

代码示例2
The following example calls the valueOf() method on an ObjectId():

ObjectId("507c7f79bcf86cd7994f6c0e").valueOf()

This will return the following string:

507c7f79bcf86cd7994f6c0e

You can confirm the type of this object using the following operation:

typeof ObjectId("507c7f79bcf86cd7994f6c0e").valueOf()