Skip to content

Instantly share code, notes, and snippets.

@steren
Created Aug 19, 2022
Embed
What would you like to do?
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