'What is a boilerplate code for connecting to Cloud Firestore from within Cloud Function?

I'm looking for boilerplate snippets for both index.js and package.json to connect from my Node.js cloud function to Cloud Firestore database under the same project with a simple read/update request as example.

ps I'm using Cloud Functions inline editor.



Solution 1:[1]

Posting link from one of the comments that helped me.

Initialize Cloud Firestore

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ocean Overflow