You can use Deli coffee special basket,then all coffee grounds will be loaded into the basket,you lift up the basket then dump the spent coffee grounds.
For larger coffee extraction machine,will use motorized plows to push out the spent coffee grounds.