Delete a Document

Last updated

What this operation supports in Google Cloud Firestore

Deletes a single document from a Firestore collection by its document path.

Implementation details

Deleting a document removes it and its own fields, but any subcollections nested beneath that document are not automatically deleted along with it -- they can be left as orphaned data unless explicitly cleaned up.

Operational considerations

Automations removing records that have nested subcollections, like a customer document with an orders subcollection beneath it, need to handle deleting those subcollections as a separate step, since Firestore won't cascade the delete automatically.

Use cases

Automate archiving and removal of stale records in Firestore.

  1. Delete expired user sessions from a session collection.
  2. Remove test documents after QA cycles in Google Cloud Firestore.
  3. Clean up temporary records created during migrations.
  4. Prune outdated event logs from a logging collection.

Need help with Google Cloud Firestore?

Tell us what you're working with. We'll follow up to schedule a free consultation and map out the fastest path to real adoption.

Book a free consultation

Tell us about your team and the software you need help with. We'll follow up to schedule a time to talk.

Open the form on its own page

Get help