title: $gte and $lte operators mongo filter string field by number
body: <p>I have a string field in MongoDB that contains years of experience, like '1 year', '3 years' etc.</p>
  <p>I need to filter this field by number</p>
  <pre><code>db.collection.find({ experience: {'$gte': '1', 'lte': '3'} })
  </code></pre>
  <p>but it filters by string i.e. '$gte': '10' returns 3, 4, 7 etc., comparing strings.</p>
  <p>I tried to create and index</p>
  <pre><code>db.profiles.createIndex( { experience: 1 }, { collation: { numericOrdering: true, locale: &quot;en_US&quot; } } )
  </code></pre>
  <p>But it didn't work. Any ideas?</p>