title: MongoDb: Benefit of using ObjectID vs a string containing an Id?
body: <p>Is there any benefit to storing an id to a related document as an ObjectId versus storing it as a string literal?</p>
  
  <p>Using ObjectID:</p>
  
  <pre><code>{
     "_id": ObjectId("522bb79455449d881b004d27"),
     "username": "admin",
     "folder": ObjectId("522bb79455449d881b004d23")
  }
  </code></pre>
  
  <p>versus a string:</p>
  
  <pre><code>{
     "_id": ObjectId("522bb79455449d881b004d27"),
     "username": "admin",
     "folder": "522bb79455449d881b004d23"
  }
  </code></pre>
  
  <p>For my API where I'm sending data back to a client... using the string means I don't have to "cleanup" the data... and as we have to do a second query to get the folder document anyway... is it worth using ObjectId? (and if so why?)</p>
  
  <p>Thanks</p>