title: Google Cloud Datastore: Storing arrays and objects
body: <p>I'm just coming from learning IndexedDB, so the concept of Google Cloud Datastore is confusing me.</p>
  
  <p>How exactly do you store arrays and objects?</p>
  
  <p>Consider this scenario:</p>
  
  <pre><code>{ category: 'football', keywords: ['foo', 'bar'] }
  { dinosaurs: { trex: { teeth: 'large' } } }
  </code></pre>
  
  <p>How exactly should I structure the database?</p>
  
  <p>In IndexedDB, you have <code>multiEntry</code> which allows for all the keywords in an array to be stored as separate entries.</p>
  
  <p>For the array: If I want to search by keyword, should I build a new entity with "kind" keywords and store each keyword as a separate entity? How would I link it to it's relevant category?</p>
  
  <p>For the object: Should I store it as a JSON string and then stringify / decode it in the script?</p>