发布于 2015-09-14 15:12:32 | 115 次阅读 | 评论: 0 | 来源: 网络整理

ObjectId.valueOf()
返回:The value of the ObjectId() object as a lowercase hexadecimal string. This value is the str attribute of the ObjectId() object.

在 2.2 版更改: In previous versions ObjectId.valueOf() returns the ObjectId() object.

In the following example, call the valueOf() method on an ObjectId (e.g. ObjectId("507c7f79bcf86cd7994f6c0e")), as follows:

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()
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务