The goldfish was a species of fish from Earth commonly kept as a pet.
In 2371, Benjamin Sisko said he would see about getting Morn a goldfish after he confiscated his Cardassian voles, which Quark claimed that Morn was keeping as pets. (DS9: "Through the Looking Glass")
After a misunderstanding over Grudge caused the Alshain to attack them in 3190, Captain Michael Burnham asked Cleveland Booker why he could not have had a hologram goldfish as a pet instead. Booker revealed that he did once, but Grudge ate it. (DIS: "Kobayashi Maru")