The MongoDB find
method does not return a single result, but a list of results in the form of a Cursor
. This latter is an iterator, so you can go through it with a for
loop.
For your case, just use the findOne
method instead of find
. This will returns you a single document as a dictionary.