title: NoSQL Database Structure
body: <p>For a small app prototype I'm building, I would like to use firestore (firebase) to store some data. I'm wondering if the following is a good way of going about a nosql database.</p>
  
  <blockquote>
    <p>I have Paths, that belong to Categories. A Path can have courses and comments. I would like users to see the likes a path has, and get categories sorted by the amount of paths inside.</p>
  </blockquote>
  
  <p>That's why I'm adding the paths_count on the categories table, I will use Cloud Functions to update the counts for the likes and paths on each database update.</p>
  
  <pre><code>categories: [
      1: {name: "productivity", paths_count: 10},
      2: {name: "cooking", paths_count: 5},
  ]
  
  paths: [
      1: {
          name: "Productivity 101",
          category_id: 1,
          likes_count: 5,
          likes: [],
          courses: [],
          comments: []
         }
  ]
  </code></pre>
  
  <p>Is this a good start? </p>