title: Firebase cloud function won't insert into firestore
body: <p>I'm trying to add a document from a firebase cloud function to firestore, but it isn't working. This is what I'm doing:</p>
  
  <pre><code>import * as admin from "firebase-admin"
  import * as functions from "firebase-functions"
  
  admin.initializeApp()
  
  exports.findDeck = functions.https.onCall((data: { deckId: string }) =&gt; {
      admin.firestore().collection("messages").add({original: "for me"})
      return requestDeck.findDeck(data.deckId)
  })
  </code></pre>
  
  <p>Seems like it should be simple enough. I'm following an example here:</p>
  
  <p><a href="https://github.com/firebase/functions-samples/blob/master/quickstarts/uppercase-firestore/functions/index.js" rel="nofollow noreferrer">https://github.com/firebase/functions-samples/blob/master/quickstarts/uppercase-firestore/functions/index.js</a></p>
  
  <p>I've also tried following the firestore docs for Node.js, and using <code>set</code> instead of <code>add</code>. None of it does anything, or seems to report an error.</p>