A collective genome representative of the many organisms, primarily microorganisms, existing in a community.