Code commented for guidance on acessing db, and how to generate the collections.