When using a cursor to iterate through a collection like so,
import pymongo
cursor = pymongo.Connection().test_db.test_collection.find()
for item in cursor:
print item
#this will print the item as a dictionary
only the values are returned. I'm looking for a way to access the name of the value.
I have found a similar method called getCollectionNames() however it is used to return every collection name in the database.
Quick [Hacky] Fix: Store the name of the collection inside the collection itself and simple call the name from the value returned by the cursor using item.name