human
Iterate through PyMongo Cursor as key-value pair
assistant
Here is some code to get a dictionary `records` of key-value pairs in PyMongo cursor `cursor`

records = dict((record['_id'], record) for record in cursor)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.