ObjectId.valueOf()
On this page本页内容
ObjectId.valueOf()
-
Returns the value of the以小写十六进制字符串的形式返回ObjectId()
as a lowercase hexadecimal string.ObjectId()
的值。This value is the此值是str
attribute of theObjectId()
object.ObjectId()
对象的str
属性。
Example实例
The following example calls the 以下示例对valueOf()
method on an ObjectId()
:ObjectId()
调用valueOf()
方法:
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()