Find all the pages having a particular slice?

I asked a similar question a while back. I was simply looking to find every document using a particular slice (without refactoring) but someone on the Prismic team pointed us in the right direction with a sample script:

1 Like