title: How to find and update in pymongo using user input
body: <p>I am creating a pymongo application that takes user input and uses CRUD methods. I want to create an update method that takes user's inputted data, uses that data to search for the specific file and then updates it with new information.</p>
  <p>Here is my current update method:</p>
  <pre><code>def update(self, data):
      if data is not None:
          self.AAC.animals.find()
          return self.AAC.animals.update({data}, {'$set', data})
      else:
          print(&quot;Nothing to update, because data parameter is empty&quot;)
          return False
  </code></pre>
  <p>What I don't understand how to do is how to take user's input and search and then take another input and use that to update.</p>
  <p>If I need to clarify anything, I'd be glad to. Thank you very much!</p>