Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kashifmin/gogoose
https://github.com/kashifmin/gogoose
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kashifmin/gogoose
- Owner: kashifmin
- Created: 2020-08-27T11:06:43.000Z (over 4 years ago)
- Default Branch: code-gen
- Last Pushed: 2020-09-03T04:55:27.000Z (over 4 years ago)
- Last Synced: 2023-08-07T00:06:06.737Z (over 1 year ago)
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gogoose
Mongoose for Go. Generates mongoose like models and document types based on your type struct.# Example
```go
func main() {
db := NewMongoClient()
userModel := gen.NewUserModel(db.Collection("kuser"))
oid := primitive.NewObjectID()
doc := userModel.New(&gogoose.User{Name: "Kashif", Age: 23, ID: &oid})
err := doc.Save(context.Background())
if err != nil {
panic(err)
}
}
```# TODO
- [ ] Concept with `.Save()` and `.FindOne()`
- [ ] Implement `Find*`, `Update*`, `Delete*`
- [ ] Implement difftracker for `.Save()`
- [ ] Implement aggregations
- [ ] Create a sample service demonstrating the uses