hello … I need to delete all entries in a collection from time to time and insert new ones. this dynamically without the dashboard. In fact, it will be powered by a Json that I will receive from another system. Has as? Has anyone done?
You can do in several ways:
- Command line - create a cli command that empties the collection entries, believe you can do:
- Rest Endpoint - create a REST endpoint that receives the collection name and runs above command (think that option could be dangerous, if doing that ensure you have a custom API key for it)
- Via a trigger action, let’s imagine that you have a singleton or other collection that when saved you want to flush some other collection, implement the proper trigger using the dropCollection method