Skip to content

Instantly share code, notes, and snippets.

@steren
Created August 19, 2022 04:52
Show Gist options
  • Save steren/92da779f6cd3f9c9cc370a50ff02e8d5 to your computer and use it in GitHub Desktop.
Save steren/92da779f6cd3f9c9cc370a50ff02e8d5 to your computer and use it in GitHub Desktop.
Firestore in Cloud Functions
const {Firestore} = require('@google-cloud/firestore');
const firestore = new Firestore();
exports.helloWorld = async (req, res) => {
const document = firestore.doc('users/steren');
const doc = await document.get();
console.log('Read the document');
res.status(200).send('Hey');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment