title: String field value length in mongoDB
body: <p>The data type of the field is String. I would like to fetch the data where character length of field name is greater than 40.</p>
  
  <p>I tried these queries but returning error.
  1. </p>
  
  <pre><code>db.usercollection.find(
  {$where: "(this.name.length &gt; 40)"}
  ).limit(2);
  
  output :error: {
      "$err" : "TypeError: Cannot read property 'length' of undefined near '40)' ",
      "code" : 16722
  }
  </code></pre>
  
  <p>this is working in 2.4.9 But my version is 2.6.5</p>