Documents and Collections in Dart

Andrea Bizzotto
A free video tutorial from Andrea Bizzotto
Flutter GDE, Developer and Instructor
4.6 instructor rating • 3 courses • 25,025 students

Learn more from the full course

Flutter & Firebase: Build a Complete App for iOS & Android

Learn Dart, Flutter & Firebase by Google, and build a real-world, production ready app

20:46:18 of on-demand video • Updated March 2021

  • Build a complete, real-world app with Flutter & Firebase
  • Write iOS & Android apps with a single codebase
  • Write production-ready code following best practices and become a competent Flutter developer
  • Fast-track your Flutter learning with practical tips and proven techniques
English [Auto] It's now time to learn about how cloud firestorm works and how we can use it to structure our data and when it comes to fires. There are two main things that we need to keep in mind. Data in firestorm is represented as a three like hierarchical structure such as this one and there are two types of items that we can put in our trade documents and collections. Now you can think of documents as data on objects or dictionaries and they consist of key value pairs which are known as fields in firestorm. And we can use them to store a number of different things such as strings and numbers and dates and also simple maps and lists as well. Now collections instead are simply a collection of documents so the only thing that we can put inside collections are documents and there is one more rule that we need to be aware of and that is that the root of the Firestone tree needs to be a collection. So how do we access documents and collections in Firestone. Well there are multiple ways but the simplest one that I recommend is to use a path. So this is just a string which is composed like this. And the important thing to notice here is that collections and documents alternate so that collections are always in all the positions and documents are always on even positions and I can guarantee that one of the most common mistakes when working with files there is to fail to follow this rule. OK so for now this is the bare minimum that we need to know about documents and collections. And by the way I have found unofficial video by the file based team which explains very well what I no sequel database is and I highly recommend that you watch it because it will help you better understand how Firestone works and these will be useful as we make progress in this course. So make sure that you watch this video and you can find the link to access it before the next video.