title: Searching using pymongo from mongodb
body: <p>I am using a flask application to query the data from mongodb. Document from the mongodb is in the following format.</p>
  <pre><code>[{'organization_name': 'Example 1', 'date': '2021-10-15', 'url': 'https://www.example1.com/events/performances/641/2019-10-13/'}, {'organization_name': 'Example 2', 'date': '2021-10-21', 'url': 'https://file2.org/masterworks'}, {'organization_name': 'Example 3', 'date': '2021-10-21', 'url': 'https://file2.org/masterworks2'}]
  </code></pre>
  <p>Right now the query and search based on url is performing like this</p>
  <pre><code>    filter_stuff = {'url': 1, 'organization_name': 1, 'date':1, '_id': 0}
      data = eventcol.find({'url': url}, filter_stuff)
  </code></pre>
  <p>Here the search only works for exact complete url. How can the search be possible like if any part of url is given, all those data having that part is returned as result.</p>
  <p>If search is <code>file2</code>  then the result be documents of <code>https://file2.org/masterworks and https://file2.org/masterworks2</code> and if search is <code>events</code> then the result be <code>https://www.example1.com/events/performances/641/2019-10-13/</code></p>