I would like to delete all entries from the live of my collection without deleting it. Is this possible?
Thank you!
I would like to delete all entries from the live of my collection without deleting it. Is this possible?
Thank you!
Hi Dani,
Through Corvid, the truncate function can be utilized to do this. In the Content Manager, deleting one-by-one is your only option.
Hi anthonyb! Thanks for answering. I already know the truncate function but it only clears my sandbox. Do I have to run it in my published site so it removes the live data?
Thanks
You have to be logged in, to do that.
Hi Dani, russian-dima
Inserting, updating, removing entries and pretty much every action you perform on collections depends on your current view mode , if you’re in the editor, you’ll only be able to play with Sandbox collections, to edit your Live collections, you need to be on the live site.
russian-dima, it’s not about if the user is logged in or not, truncate requires that the user performing this command is the Site Owner , other logged in users don’t have permissions to do so, as a way around or as a second option, you can run this command on in Backend by bypassing the permissions.
Hi russian-dima. How logged it? You mean in the published website?
Thanks!
Hi, solved! Thank you!
Hi Dani, russian-dima
Inserting, updating, removing and pretty much any function that you can run on collections depends on the current site view mode , that means if you’re in the editor you can only play with Sandbox collections, if you want to perform actions on Live collections, you need to perform these actions on the live site.
truncate() works on both Sandbox & Live collections, and affects collections based on the current view mode , that means if you’re in the editor, truncate() will only affect collections in Sandbox .
russian-diam , logging in is not a requirement by itself for truncate() to run, it requires the user to be the Site Owner , otherwise you’ll get a 403 error no matter who called this function whether he was logged in or not.
Of course as a second option, you can call this function in the Backend and bypassing the permissions, here’s how .
Ahmad