title: How to send data via HTTP request to Firestore database
body: <p>So, I am trying to make an app with Node.js, Vue, and Firebase. I currently have a very basic function using firebase functions to send data to the realtime database via http request. I cant figure out how to do the same for Firestore database.</p>
  <p>My goal is to send data or a file of some JSON data to my Firestore database from outside the app with an HTTP request. I know how to deploy functions I just am not sure how to send files or JSON to the database for further use.</p>
  <p>Any help is greatly appreciated!</p>
  <p>I have been playing around with different functions but can't seem to figure it out. I have looked at many of the docs/videos for firebase but I am pretty knew to this and can't quite grasp it.</p>
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin')
  admin.initializeApp() //need admin sdk
  
  const toUpperCase = (string) =&gt; string.toUpperCase();
  
  exports.addMessage = functions.https.onRequest((request, response) =&gt; {
  const text = request.query.text;
  
  const secretText = toUpperCase(text);
  
  admin
      .database()
      .ref('/sentMSG')
      .push({ text: secretText })
      .then(() =&gt;
          response.json({
              message: 'great!!!!',
              text
          })
      )
      .catch(() =&gt; {
          response.json({
              message: 'not great :^('
          });
      });
  });
  
  exports.writeToStore = functions.firestore.https.onRequest((request, 
  response) =&gt; {
    let data = request.query.text
    let setDoc = db.collection('cities').doc('LA').set(data)
     .then(() =&gt;
          response.json({
              message: 'great!!!!',
              text
          })
      )
      .catch(() =&gt; {
          response.json({
              message: 'not great :^('
          });
      });
  });
  </code></pre>
  <p>The addMessage function adds data to realtime database but I need to do it for Firestore</p>