title: Search in mongodb for text and integer
body: <p>I have a app which will need to perform search for both string and integer type. I tried analysing and got the solution to use full text search feature for mongodb( atlas) which is working fine, but i need to do a integer search also for the same in which case this feature seems to be not a good one.Below is the code i tried</p>
  <pre><code>if(typeof(search_Value)!== &quot;string&quot;){
  
  var getSearchResult=collection_name.find({
      &quot;$expr&quot;: {
          &quot;$regexMatch&quot;: {
             &quot;input&quot;: {&quot;$toString&quot;: &quot;$orderId&quot;}, 
             &quot;regex&quot;: /123/
          }
      }
  }).limit(10).skip(5) //for pagination
  }
  else{
   var getSearchResult=collection_name.find({$text: {$search: &quot;london&quot;}}).limit(10).skip(5) // for pagination
  }
  </code></pre>
  <p>I need a more guidance as how can I proceed the same in a single function to handle both text and integer search? I searched some plugins but they all seem to be supporting only text search .Kindly help me regarding this.</p>