我想在 JavaScript 中将 ObjectID (Mongodb) 转换为 String。 当我得到一个对象形式的 MongoDB 时。它就像一个对象有:时间戳,秒,公司,机器。 我无法转换为字符串。
最佳答案
试试这个:
objectId.str
见 doc .
ObjectId()
has the following attribute and methods:[...]
str
- Returns the hexadecimal string representation of the object.
关于javascript - 在 JavaScript 中将 ObjectID (Mongodb) 转换为字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16478552/