This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Removes all items from a collection.
The truncate()
method returns a Promise that resolves after all items
have been removed from the specified collection.
truncate()
runs when the current user is the site owner, or when the method is called with elevated permissions.
Note: truncate()
also clears multiple-item reference fields in collections referenced by the specified collection. For example, suppose you have a Movies collection with an Actors field that contains multiple references to items in a People collection. Truncating the Movies collection also clears the data in the corresponding multiple-item reference field in the People collection.
ID of the collection to truncate.