title: PyMongo error: cannot convert value of type to bson
body: <p>I'm using flask with pymongo, and i have the error:</p>
  
  <blockquote>
    <p>bson.errors.InvalidDocument</p>
    
    <p>InvalidDocument: cannot convert value of type  to bso</p>
  </blockquote>
  
  <p>My code for this error is:</p>
  
  <pre><code>    def get_question_with_id(id,question):
           question = db.questions.find_one({'id': id})
           return question,id
  </code></pre>
  
  <p>I searched for many hours  for one solution, but i did not find answer for this problem.
  what is this error?</p>