O'Reilly logo

Mastering Firebase for Android Development by Ashok Kumar S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Choosing a data structure for your Firestore project

For many use cases, having nested data in documents works well than with other structures. Similarly, before we go forward to implement the data structure plan, there are three main possibilities for the data structure, which are nested data in documents, sub-collections, and root level collections. 

Firestore supports all the primitive data types and also some of the modern data types as well. Firestore supports array, boolean, bytes, date and time, floating point numbers, geographical points, integer, map, NULL, reference, and text string. 

When the query involves fields with mixed types, Firestore uses deterministic ordering. The ordering is enlisted as follows: 

  1. Null values
  2. Boolean ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required