Implement trimming for capped collections