July 19, 2019
/cities
is a collection. /cities/mumbai
is a doc. /cities/mumbai/districts
is a collectionYou use get
on a document to get the doc, then doc.data()
to get the data inside.
Eg: If we’d started with the document data as {name: 'AniketSMK', eye_colour:'black'}
then the outcome of the above commands would be:
{name:'Aniket'}
{name:'Aniket', eye_colour:'black'}
Have suggestions for a topic I should cover? Send me a dm at @AniketSMK or email me at hello@[firstname][lastname].com
Written by Aniket Kadam - building useful things. Follow me on Twitter