Skip to content

Instantly share code, notes, and snippets.

@dandv
Last active January 5, 2025 14:59
Show Gist options
  • Save dandv/f5128978e70895eff0f66f0557c2b863 to your computer and use it in GitHub Desktop.
Save dandv/f5128978e70895eff0f66f0557c2b863 to your computer and use it in GitHub Desktop.
recursiveDelete fails with "Error: 0 deletes failed. The last delete failed with"
import { initializeApp, cert } from 'npm:firebase-admin/app';
import { getFirestore } from 'npm:firebase-admin/firestore';
const serviceAccount = 'service-account-key.json';
initializeApp({ credential: cert(serviceAccount) });
export const db = getFirestore('nonexistent');
await db.recursiveDelete(db.collection('docs'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment