title: mongoose objectid to number
body: <p>How can I cast an ObjectId to a number? In my app I'm using the latest mongoose version and backbone on the clientside.</p>
  
  <p>My problem is that the ObjectId always ends up being put in between quotes which results in double quotes like ""233453452534"" in my jade templates and on my client.</p>
  
  <hr>
  
  <p>edit:</p>
  
  <p>I'm querying mongodb with</p>
  
  <pre><code>this.users.find({},function(err,docs){
    cb(null,docs)
  })
  </code></pre>
  
  <p>console.log(docs) shows</p>
  
  <pre><code>{ name: 'test',
   _id: 5220bc207f0c866f18000001,
   __v: 0 }
  </code></pre>
  
  <p>in my template</p>
  
  <pre><code>option(data-id=val._id) #{val.name}
  </code></pre>
  
  <p>i pass this to res.render</p>
  
  <pre><code>res.render('test.jade',docs)
  </code></pre>
  
  <p>and my html renders:</p>
  
  <pre><code>""5220bb43b754af4118000001""
  </code></pre>
  
  <p>with double quotes arround my object id.
  i tried to set a number in a schema and this works, no quotes arround it if it's a number, so my guess is that that happens because it's an objectID.</p>