A collective consciousness, or group consciousness, is a state whereby multiple individuals may be linked together telepathically, and share one another's experiences and memories.
The nanites that developed on the USS Enterprise-D in 2366 were thought to possess a collective intelligence. A number of them inhabited Lieutenant commander Data in order to communicate with the crew. (TNG: "Evolution")
Perhaps the most notable example of a collective consciousness encountered by Starfleet was the Borg Collective, the hive mind in which all Borg drones existed, sharing thoughts, memories, and functions. (TNG: "Q Who"; Star Trek: First Contact; VOY: "Waking Moments")