https://github.com/night-codes/mgo-wrapper
Wrapper for package mgo with auto reconnect
https://github.com/night-codes/mgo-wrapper
Last synced: 23 days ago
JSON representation
Wrapper for package mgo with auto reconnect
- Host: GitHub
- URL: https://github.com/night-codes/mgo-wrapper
- Owner: night-codes
- License: wtfpl
- Created: 2016-02-22T11:43:28.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-22T15:03:36.000Z (almost 10 years ago)
- Last Synced: 2025-01-23T23:32:40.397Z (12 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mgo-wrapper (mongo)
Wrapper for package mgo with auto reconnect
## How To Use
Set environment variable DBHOST like "localhost:27017" if you want to use non-standard port or host
```go
package main
type (
obj map[string]interface{}
prod struct{
// ....
}
)
import (
"github.com/mirrr/mgo-wrapper"
"fmt"
)
func main() {
products := []prod{}
mongo.DB("myDataBase").C("products").Find(obj{}).All(&products)
fmt.Println(products)
}
```
## License
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Oleksiy Chechel
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.