UNPKG

firebase-tools-extra

Version:

Extra functionality for firebase-tools with support for emulators and auth through service account.

27 lines (26 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var firestore_1 = require("../actions/firestore"); /** * @name firestoreDelete * Delete data from Cloud Firestore. Works for both hosted and emulated environments * @param {object} program - Commander program */ function firestoreDeleteCommand(program) { program .command('firestore:delete <path>') .description('Delete data from Cloud Firestore. Works for both hosted and emulated environments') .option('--shallow', 'Shallow. Delete only parent documents and ignore documents in subcollections. Any action which would orphan documents will fail if this argument is not passed. May not be passed along with -r.') // .option( // '-r, --recursive', // 'Recursive. Delete all documents and subcollections. Any action which would result in the deletion of child documents will fail if this argument is not passed. May not be passed along with --shallow.' // ) .option('--emulator', 'use Firestore emulator') .option('--debug', 'print verbose debug output to console') .action(function (dbPath, options) { return firestore_1.firestoreDelete(dbPath, options) .then(function () { return process.exit(0); }) .catch(function () { return process.exit(1); }); }); } exports.default = firestoreDeleteCommand;