title: How to set foreign keys in Firestore?
body: <p>As an instance think of an e-commerce app where a user can upload as many as items and those items have categories and subcategories.</p>
  
  <p>How to set user_id as a foreign key in each items posted as well as item_id in users collection in order to query all the items posted by a specific user. </p>
  
  <p>How do we make use of <strong>reference data type</strong> in Firestore to set foreign keys?</p>
  
  <p>Are there any other methods to set foreign keys?</p>
  
  <p>Database Structure:</p>
  
  <pre><code>Users/doc_id/name..
  
  Categories/fashion/clothing/auto_doc_id/type:denims
  </code></pre>