Join us live Sept. 27 – How Sanity and Vercel powered Morning Brew's transformation –>

How to delete all docs of a specific doc type via cli?

3 replies
Last updated: Nov 13, 2020

Hi all, just ran an import, there's some issues with some of the data so I need to delete all docs of a specific doc type... any ideas via cli?

Nov 11, 2020, 2:58 PM

  query: `*[_type == "post"]`

Nov 11, 2020, 3:40 PM

And allow read/write access to your token

Nov 11, 2020, 3:41 PM

Thanks for the tip!

Nov 13, 2020, 12:58 PM Get the most out of your content is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Free to get started, pay-as-you-go on all plans.