Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bariseser/mongodb_adapter
Mongodb Adapter for Go
https://github.com/bariseser/mongodb_adapter
go golang gomodule mongodb
Last synced: 3 days ago
JSON representation
Mongodb Adapter for Go
- Host: GitHub
- URL: https://github.com/bariseser/mongodb_adapter
- Owner: bariseser
- License: mit
- Created: 2019-09-27T13:32:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T13:45:35.000Z (about 5 years ago)
- Last Synced: 2023-03-10T23:43:27.479Z (over 1 year ago)
- Topics: go, golang, gomodule, mongodb
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MongoDB Adapter for Go
This module help to you some mongo command which add, get and del
### Connect to Redis
````go
mongoClient = ConnectMongo("mongodb://localhost:23176", , "dbname", "CollectionName")
````### Find
````go
err := mongoClient.GetData(bson.D{{filters}}, interface{})if err != nil {
log.Fatal(err.Error())
}
````### All Rows
````go
err := mongoClient.GetAll(bson.D{{filters}}, interface{})if err != nil {
log.Fatal(err.Error())
}
````### Insert
````go
err := mongoClient.GetAll(bson.D{{filters}}, interface{})if err != nil {
log.Fatal(err.Error())
}
````### Update
````go
err := mongoClient.GetAll(bson.D{{filters}}, bson.D{{filters}})if err != nil {
log.Fatal(err.Error())
}
````### Delete
````go
err := mongoClient.DeleteData(bson.D{{filters}})if err != nil {
log.Fatal(err.Error())
}
````