I am trying to remove a collection using callable firebase function.
I took a sample code from here.
The sample code has a \"firebase_tools\" element.
<If you look in the same document you refer to, you will find a link to the sample code: https://github.com/firebase/snippets-node/tree/master/firestore/solution-deletes
Then if you look at the Cloud Function code (index.js) you will see that this sample starts as follows:
const admin = require('firebase-admin');
const firebase_tools = require('firebase-tools');
const functions = require('firebase-functions');
admin.initializeApp();
So you need to:
npm i firebase-tools
.const firebase_tools = require('firebase-tools');
as shown in the sample.You will then be able to call firebase_tools.firestore.delete()
.