Skip to content

Commit

Permalink
chore: Fix firestore sub collection handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Jul 19, 2021
1 parent 9ee5d63 commit fcc7f10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/plugins/document/firestore/firestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,17 @@ func (s *FirestoreDocService) Query(collection *sdk.Collection, expressions []sd
Id: docSnp.Ref.ID,
},
}

if p := docSnp.Ref.Parent.Parent; p != nil {
sdkDoc.Key.Collection = &sdk.Collection{
Name: collection.Name,
Parent: &sdk.Key{
Collection: collection.Parent.Collection,
Id: p.ID,
},
}
}

queryResult.Documents = append(queryResult.Documents, sdkDoc)

// If query limit configured determine continue tokens
Expand Down

0 comments on commit fcc7f10

Please sign in to comment.