为什么mongodb包裹objectid('')到字符串
MongoDB将字符串值与数据库中的ObjectID('')一起包装。
当我用端点提出帖子请求时,我会得到200个响应,并且看到了类型字符串的 creatorid 属性的正确值。
为什么这样做?我可以关闭此选项吗?
我的其他ID属性(在1级上)是对象的唯一ID,并且会自动生成。两者都是类型字符串。
任何帮助将不胜感激!
Mongodb keeps wrapping a string value with ObjectId(' ') in the database.
when I make a POST request with my endpoint, I get a 200 response and I see the correct value for my creatorID property that is of type string.
but in MongoDB it is saved like this:
why is it doing that? and can I turn this option off?
my other Id property (on level 1) is the unique id of the object and it gets automatically generated. Both are of type string.
any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可以自动创建自己的独特定义,您可以关闭此功能。
有关更多详细信息
示例
It can make its own unique definition automatically, you can turn this feature off.
for more detail
example :
or