Merge pull request #9 from nanobox-io/update/readme

updating readme to match how scribble actually works; there was a ref…
This commit is contained in:
Steve Domino 2015-12-17 17:18:03 -07:00
commit a99eef6876
2 changed files with 14 additions and 9 deletions

View File

@ -25,20 +25,20 @@ if err := db.Write("fish", "onefish", fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Read all fish from the database // Read a fish from the database (passing fish by reference)
fish := []Fish{} fish := []Fish{}
if err := db.Read("fish", "", fish); err != nil { if err := db.Read("fish", "onefish", &fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Read a fish from the database // Read all fish from the database, unmarshaling the response.
fish := Fish{} records, err := db.ReadAll("fish")
if err := db.Read("fish", "onefish", fish); err != nil { if err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Delete all fish from the database fish := []Fish{}
if err := db.Delete("fish", ""); err != nil { if err := json.Unmarshal(records, &fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
@ -46,6 +46,11 @@ if err := db.Delete("fish", ""); err != nil {
if err := db.Delete("fish", "onefish"); err != nil { if err := db.Delete("fish", "onefish"); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Delete all fish from the database
if err := db.Delete("fish", ""); err != nil {
fmt.Println("Error", err)
}
``` ```
## Documentation ## Documentation
@ -57,7 +62,7 @@ Complete documentation is available on [godoc](http://godoc.org/github.com/nanob
- Better support for concurrency - Better support for concurrency
- Better support for sub collections - Better support for sub collections
- More methods to allow different types of reads/writes - More methods to allow different types of reads/writes
- More tests (you can never have enough) - More tests (you can never have enough!)
## Contributing ## Contributing

View File

@ -11,7 +11,7 @@ import (
"sync" "sync"
) )
const Version = "1.0.3" const Version = "1.0.4"
type ( type (