title: Searching ID or property for match in Mongo
body: <p><strong>Goal</strong>:</p>
  
  <p>I want to allow the user to search for a document by ID, or allow other text-based queries.</p>
  
  <p><strong>Code</strong>:</p>
  
  <pre><code>l_search_results = list(
      cll_sips.find(
          {
              '$or': [
                  {'_id': ObjectId(s_term)},
                  {'s_text': re.compile(s_term, re.IGNORECASE)},
                  {'choices': re.compile(s_term, re.IGNORECASE)}
              ]
          }
      ).limit(20)
  )
  </code></pre>
  
  <p><strong>Error</strong>:</p>
  
  <p><code>&lt;Whatever you searched for&gt; is not a valid ObjectId</code></p>