title: mongodb using where with different column names
body: <p>I m having a four records in a table out of which one is having a different column name (<strong>"usernm"</strong> below)-</p>
  
  <pre><code>{ "_id" : ObjectId("583d67ec8a2a25b70f6af482"), "username" : "pradyut", "password" : "hello123" }
  { "_id" : ObjectId("583d68328a2a25b70f6af483"), "username" : "google", "password" : "google123" }
  { "_id" : ObjectId("583d71902a7b4dfc334d1ab4"), "usernm" : "praddy", "password": "google123" }
  { "_id" : ObjectId("583d71b82a7b4dfc334d1ab5"), "username" : "some", "password": "some123" }
  </code></pre>
  
  <p>The below <strong>where</strong> command is not working </p>
  
  <pre><code>db.users.find({$where:"this.username.length&gt;=2"});
  </code></pre>
  
  <p>and throwing the error  - </p>
  
  <pre><code> Error: error: {
  "ok" : 0,
  "errmsg" : "TypeError: this.username is undefined :\n_funcs3@:1:24\n",
  "code" : 139
  }
  </code></pre>
  
  <p>On removing the <strong>"usernm"</strong> column, it works fine</p>
  
  <pre><code>db.users.remove({usernm:"praddy"});
  </code></pre>