title: How to write data to firestore through firebase functions?
body: <p>I can quite easily find how to add triggers for firestore events but I can't find any documentation on how to use firebase functions to write to firestore.</p>
  
  <p>For example I have the following:</p>
  
  <pre><code>export const listener = functions.auth.user().onCreate((x)=&gt;{
      //firestore function to add an entry for user with fields...
  })
  </code></pre>
  
  <p>There doesn't seem to be a way to do this? Is it that the logic for adding data to firestore should be written client side? If so wouldn't that mean I would need to re-write that functionality for every platform?</p>