An ORM Framework for go-mongo
// 1. init database
ConnectMongo(...)
// 2. init collection binding
// store all `Person` in `db.COL_People`
SetCollectionByName[Person]("COL_People")
// 3. enjoy CRUD
val, ok := Mongorm.FindOne[Person](bson.M{"Name": "xxx"})
// or Replace, Delete, ...Threr are 3 types to bind Mongo-Collections with Go-Type
ConnectMongothenSetCollectionByName(col_name)ConnectMongoand defaults to usereflect.Type.Name()as collection name- Init Mongo elsewhere and
SetCollection(col)
- Golang >= 1.18
- gomongo - go.mongodb.org/mongo-driver/mongo
- logrus - github.com/sirupsen/logrus