Skip to content

Commit

Permalink
Issue ostafen#51:
Browse files Browse the repository at this point in the history
- inverting condition.
  • Loading branch information
DaniloMarques1 committed Jun 5, 2022
1 parent 819c0c8 commit e80aa4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,6 @@ func TestSliceIndexing(t *testing.T) {
require.Nil(t, d1.Get("genre.first"))
require.Nil(t, d1.Get("authors.name"))
require.Equal(t, "The final problem", d0.Get("authors.0.bio.best_sellers.0.2"))
require.Nil(t, d1.Get("authors.0.bio.best_sellers.0"))
require.Nil(t, d1.Get("authors.0.bio.best_sellers.0"))
})
}
6 changes: 3 additions & 3 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[
if isSlice {
if i < end-1 {
v, increment := lookupSliceField(fields[i+1:], 2, s)
if m, isMap := v.(map[string]interface{}); isMap {
currMap = m
} else if v == nil {
if v == nil {
return nil, nil, ""
} else if m, isMap := v.(map[string]interface{}); isMap {
currMap = m
} else {
f = v
}
Expand Down

0 comments on commit e80aa4e

Please sign in to comment.