Yes, like they did on the space shuttle and today on the ISS, but in Apollo days they put it in bags. Entirely manual. You taped the bag to yourself.
Urine was deposited outside. “Constellation Urine” as Wally Schirra called it. That used some vacuum tech as you attached yourself to a tube. I guess it hurt sometimes because of the vacuum portion. Then it was dumped. In Apollo 13 the crew was told to stop the dumps because they were worried about them affecting their trajectory. That request was rescinded but the crew didn’t realize it. So they had bags of urine taped all over the inside of the spacecraft and the moisture was causing the tape to come off. So it’s cold, dark, hungry, and bags of piss everywhere.
in some Apollo missions the fecal bags were carefully labeled and analyzed later by scientists to see how the body digested food in zero G. Everything in they ate was carefully logged.