ObjectId.toString()

在本页面

Example

以下示例在mongo shell 中的ObjectId()实例上调用toString()方法:

ObjectId("507c7f79bcf86cd7994f6c0e").toString()

这将返回以下字符串:

ObjectId("507c7f79bcf86cd7994f6c0e")

您可以使用以下操作确认该对象的类型:

typeof ObjectId("507c7f79bcf86cd7994f6c0e").toString()
首页