👀 See Sanity in action: Watch product demo now →

Is there an easy way of clearing unwanted published items?

5 replies
Last updated: Oct 30, 2020
HI I have published once but my data shows an array?
"result":[2 items
0:{6 items
"_createdAt":"2020-10-30T07:44:59Z"
"_id":"932ebb41-cf8d-463d-9ad9-6e4c88588b54"
"_rev":"XNtMa4Y66vmVFnyOJAoV3C"
"_type":"siteSettings"
"_updatedAt":"2020-10-30T08:08:55Z"
"owner":{4 items
"facebook":"@facebook"
"instagram":"@instagram"
"name":"Amy Robers"
"twitter":"@twitter"
}
}
1:{8 items
"_createdAt":"2020-10-30T11:51:03Z"
"_id":"siteSettings"
"_rev":"XNtMa4Y66vmVFnyOJEK8AQ"
"_type":"siteSettings"
"_updatedAt":"2020-10-30T15:53:17Z"
"name":"Amy"
"person":{3 items
"facebook":"<https://yourfacebookurl/>"
"instagram":"<https://yourinstagramurl/>"
"twitter":"<https://yourtwitterurl/>"
}
"website":"<http://yogawithamy.com|yogawithamy.com>"
}
]
How can I clear that first array? Thanks
Oct 30, 2020, 3:56 PM
Looks like you’re querying
_type == "siteSettings"
and you’ve published several siteSettings documents already. Try
*[_id == "siteSettings"][0]
instead
Oct 30, 2020, 4:06 PM
Thanks! Is there an easy way of clearing unwanted published items?
Oct 30, 2020, 4:08 PM
Hi James, you could run
sanity documents delete &lt;id&gt;
to delete a single document.
Oct 30, 2020, 5:01 PM
Hi James, you could run
sanity documents delete &lt;id&gt;
to delete a single document.
Oct 30, 2020, 5:01 PM
Thanks for the help . Much appreciated. Command line did the trick ⛑️
Oct 30, 2020, 11:43 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.