我有一个应用程序正在运行,当我在字符串中进行查找时遇到了一些问题(即使它是一个 ObjectId),我已经尝试使用mongoose.Types.ObjectId(' 53cb6b9b4f4ddef1ad47f943 ')
(示例)将 String 转换为 ObjectId,即使这样我无法获得回报,它返回以下错误:
Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
还给我回复:
this.id.charCodeAt is not a function
有没有人遇到过这个问题?
尝试修剪字符串中的空格
mongoose.Types.ObjectId ('53cb6b9b4f4ddef1ad47f943')
抱歉,是输入错误...整洁 =)
嗨,比卡什
最有用的评论
尝试修剪字符串中的空格