How to prune and clean up a UniFi Controller MongoDB
This script is a copy of this thread in the UI community forums code, but reformatted.
It's purpose is to clean up the UniFi Controllers MongoDB regularily and should probably best be used with a cron job.
The official docs can be found here.
Usage:
Switch var dryrun = false;
before running the script.