使用自动化bigint ID的REST API阅读问题
当我尝试从数据库中阅读时,我的REST API有一些问题。 现在,我的服务器堆栈是Nestjs + Prisma + Cockroackdb,
当我生成一个新用户时,帖子都很棒,然后将其转到我的数据库。 但是,当我试图从中读取它确实错误,并给了我一个错误,说这不能序列化bigint。
我谷歌搜索了很多东西,并找到了一个修复程序(“ Json-bigint-patch”),但是现在没有遇到错误,而是返回了我的“ null”。
稍后我发现是否手动更改较小数字的自动化ID,我会根据自己的期望获得结果。
现在,我一直坚持下去,我不知道如何解决这个问题。
感谢您提前的帮助
:我真的很新
I'm having some issues with my rest api when I try to read from database.
My server stack right now is NestJS + Prisma + Cockroachdb
At first when I generated a new User, with a POST, all went great and got it to go to my database.
But when I tried to read from it it went really wrong and gave me an error, saying that couldn't serialize a BigInt.
I googled a lot and found a fix for it ('json-bigint-patch'), but now instead of getting an error it just returns me 'null'.
Later I found out if I manually change the autogenerated ID for a smaller number, I get the result as I was expecting.
So right now I'm stuck with this and I dont know how to solve this issue.
Thanks for your help in advance
Note: I'm really new at all this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论