Home >Backend Development >Golang >About a mongodb and golang team-up pit

About a mongodb and golang team-up pit

藏色散人
藏色散人forward
2021-04-20 14:19:092297browse

The following tutorial column will introduce mongodb and golang to you in the golang tutorial column. I hope it will be helpful to friends in need!

About a mongodb and golang team-up pit

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:

About a mongodb and golang team-up pit

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...

The above is the detailed content of About a mongodb and golang team-up pit. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete