Created
August 19, 2022 04:52
-
-
Save steren/92da779f6cd3f9c9cc370a50ff02e8d5 to your computer and use it in GitHub Desktop.
Firestore in Cloud Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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