Background
At first, I planned to use golang mongodb to do it. I also checked some information online and found that mongodb's model and golang's struct are a good match. And as a front-end person, I have used nodejs and mongodb before, so I thought about using golang mongodb so that I would be more familiar with it.
Question
Nothing went wrong in the early preparations, but later I discovered: How to do related queries?
Then search for various keywords on the Internet, read other people’s code communities and ask questions.
Finally, I patiently found the official documentation:
https://docs.mongodb.com/manual/reference/database-references/
As you can see, golang’s driver does not support DBRefs, which is heartbreaking.
Conclusion
It seems that strongly typed languages are still suitable for relational databases like mysql.
Hey, let’s not talk anymore, change to mysql and continue coding~.~
(Personal understanding, I have little talent and knowledge, and I have misunderstood guidance...