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

🚀 [enhancement] better query #215

Open
Chronostasys opened this issue Mar 20, 2021 · 1 comment
Open

🚀 [enhancement] better query #215

Chronostasys opened this issue Mar 20, 2021 · 1 comment
Assignees
Labels
backend enhancement New feature or request
Milestone

Comments

@Chronostasys
Copy link
Member

跨集合查询应该用aggregate框架,之前我一直不会用。。
参考https://www.mongodb.com/blog/post/quick-start-golang--mongodb--data-aggregation-pipeline
同时要加商合理的index,之前因为数据量少一直没怎么加
然后mongodb的返回值其实可以直接用bson.M(就是map[string]interface{})接收,方便很多,以后model也不用写json tag了

@Chronostasys Chronostasys added enhancement New feature or request backend labels Mar 20, 2021
@Chronostasys Chronostasys self-assigned this Mar 20, 2021
@Chronostasys Chronostasys added this to the v0.2 milestone Mar 20, 2021
@Chronostasys
Copy link
Member Author

查了一些资料,我不确定把多个api替换成一个aggeregate查询是否有意义了。。也许这个不需要改呢

@Chronostasys Chronostasys modified the milestones: v0.2, Proposal Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant