Created
April 17, 2018 06:18
-
-
Save ryanmats/6c587c4feec696e19b6cd99cfa2c1422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "google/cloud/firestore" | |
firestore = Google::Cloud::Firestore.new(project_id: project_id) | |
cities_ref = firestore.col "cities" | |
query = cities_ref | |
query.get do |document_snapshot| | |
puts "Deleting document #{document_snapshot.document_id}." | |
document_ref = document_snapshot.ref | |
document_ref.delete | |
end | |
puts "Finished deleting all documents from the collection." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment