Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增文章Mongo中_id(主键)重写为空字符串异常 #18

Closed
acexy opened this issue May 16, 2017 · 1 comment
Closed

新增文章Mongo中_id(主键)重写为空字符串异常 #18

acexy opened this issue May 16, 2017 · 1 comment

Comments

@acexy
Copy link

acexy commented May 16, 2017

Hi Sky,

    我发现后端在新增文章时,保存的文章表post中_id字段会出现为空字符串的情况,看了下保存的逻辑_id在保存时应该是有另行赋值,但是实际情况保存完毕后_id的值等于空字符串,导致后面几个问题。

   1.保存完毕后更新由于_id等于空字符串,则更新时无法确定具体数据列
   2.新增文章的_id也会是默认空字符导致新增会被识别为在更新_id为空字符串的数据

  Node Mongoose用得比较少,不知道_id是否在mongoose中能够缺省,让mongodb自动生_id:Object("") 
@eshengsky
Copy link
Owner

是从Jade模板引擎改造成Saker过程中引发的Bug,已修复:e97a3d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants