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

【实践相关】MongoDB集合命名规范 #30

Open
guapi233 opened this issue Oct 27, 2020 · 0 comments
Open

【实践相关】MongoDB集合命名规范 #30

guapi233 opened this issue Oct 27, 2020 · 0 comments
Labels
bug Something isn't working 工具库使用 对工具库的使用经验

Comments

@guapi233
Copy link
Owner

guapi233 commented Oct 27, 2020

MongoDB集合命名规范

一定一定要以单词的复数形式集合名字,不然在通过mongoose操作时会发现自己操作的数据库与自己创建的不是一个集合,经常会操作出出乎意料的数据。

这是因为mongoose在与数据集合关联时,会自动将集合名转换为复数形式

追加

文档中的属性如果是一个数组,属性名也要为复数

@guapi233 guapi233 added bug Something isn't working 工具库使用 对工具库的使用经验 labels Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 工具库使用 对工具库的使用经验
Projects
None yet
Development

No branches or pull requests

1 participant