On this page本页内容
ObjectId.valueOf()
Returns the value of the 以小写十六进制字符串形式返回ObjectId()
as a lowercase hexadecimal string. ObjectId()
的值。This value is the 该值是str
attribute of the ObjectId()
object.ObjectId()
对象的str
属性。
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()