Skip to content

Commit

Permalink
Updated README to include nested field query example
Browse files Browse the repository at this point in the history
  • Loading branch information
timshannon committed Jun 2, 2018
1 parent d721452 commit 525de81
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -74,6 +74,21 @@ store.Find(&result, bolthold.Where(bolthold.Key).Ne(value))

```

You can access nested structure fields in queries like this:

```Go
type Repo struct {
Name string
Contact ContactPerson
}

type ContactPerson struct {
Name string
}

store.Find(&repo, bolthold.Where("Contact.Name").Eq("some-name")
```

Instead of passing in a specific value to compare against in a query, you can compare against another field in the same
struct. Consider the following struct:

Expand Down

0 comments on commit 525de81

Please sign in to comment.