0

When adding something as a datatype/reference on a firestore object key, is it possible to request it as embedded afterwards?

I.E. 
book :{
  chapters: [] <- array of references to chapters from a chapter collection. possible to request these as embedded?
}
skxc
  • 275
  • 1
  • 2
  • 13

1 Answers1

0

Unfortunately joining of data like this isn't a feature of Firestore.

The reference data type makes it easy for you to obtain the reference and attach a listener to it, but it doesn't automatically join data from the reference location.

For more details on the differences between using the reference data type versus just the key of foreign data, see my answer on this question.

Grimthorr
  • 6,856
  • 5
  • 41
  • 53
  • Thank you! That definitely clears things up, I didn't know what was the purpose of references. – skxc Nov 10 '17 at 10:18