title: python - Cloud Firestore - append data to subcollection
body: <p>Is it possible to append data to a subcollection in the cloud firestore database using the python firebase admin sdk? If so, what am i missing?</p>
  
  <p>I am trying to append data into a subcollection of a specific document located in googles cloud firestore - Not the real time database. I have done a fair amount of research with this being the most prevalent resource so far: 
  <a href="https://firebase.google.com/docs/firestore/manage-data/add-data" rel="nofollow noreferrer">add data to firestore</a> which does not explicitly say it isn't possible</p>
  
  <p>i am able to create documents, read documents, etc. i just cannot seem to append to or access subcollections without getting the whole document</p>
  
  <p>the flow of my code goes as follows:</p>
  
  <pre><code>import time
  import json
  import firebase_admin
  from firebase_admin import credentials
  from firebase_admin import db
  from firebase_admin import firestore
  
  #authentication
  cred = credentials.Certificate('key.json')
  app = firebase_admin.initialize_app(cred)
  
  cloudDb = firestore.client()    #open connection. uses 'app' implicitly
  doc = cloudDb.collection(collection).document(document)
  data['date'] = firestore.SERVER_TIMESTAMP
  data['payload'] = [0,1,2,3,4,5]
  doc.collection("data").set(data)   #*
  
  #--testing (collection)
  # |
  #----docId  (document)
  #   |
  #------company (field)
  #------accountinfo(field)
  #------data (subcollection)
  #     |
  #--------date (field)
  #--------payload (array)
  </code></pre>
  
  <p>this however fails on the last line (line with asterisk) with the error:</p>
  
  <pre><code>('Cannot convert to a Firestore Value', &lt;object object at 0xb6b07e60&gt;, 'Invalid type', &lt;class 'object'&gt;)
  </code></pre>