Read and Write Data from Cloud Firestore

Learn data querying and query structure in reading and writing the Firestore database.

Data modeling

In this lesson, we’re going to model the data we’ll be retrieving from the user and mapping it to our Firestore database.

Defining the data model class

We start by creating a class to represent the data. The data we’re going to model includes username, age, region, no_of_trees, and biogrphy.We also need to know the type of data. For our case, most of the data will be of String type, but we also have age, which must be of type integer.

Get hands-on with 1200+ tech skills courses.