Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wolveix committed Jul 17, 2020
1 parent f0fd541 commit 13d7a52
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Expand Up @@ -281,10 +281,18 @@ to create the database, create the tables you expect, and create any indexes. W
and put any type of data you want in it.

```Go
store, err := badgerhold.Open(badgerhold.DefaultOptions(filename))
options := badgerhold.DefaultOptions
options.Dir = "data"
options.ValueDir = "data"

store, err := badgerhold.Open(options)
defer store.Close()
if err != nil {
//handle error
// handle error
log.Fatal(err)
}


err = store.Insert("key", &Item{
Name: "Test Name",
Created: time.Now(),
Expand Down

0 comments on commit 13d7a52

Please sign in to comment.