title: Mongod: inserting entry with customer _id (monk/node.js)
body: <p>I have read that any <code>_id</code> type can be used except for Array. (But cannot seem to find. Can you guys confirm this please?)</p>
  
  <p>I would like the username (string) to be the <code>_id</code> for performance reasons.</p>
  
  <p>In Node.js:</p>
  
  <pre><code>const monk = require('monk');
  const db = monk('localhost:27017/test',
      function(err) {
          if(err)
              console.log(err.toString());
      });
  //const doc = {user: 'aa', password: 'password'};
  //const doc = {_id: 'aa', password: 'password'};
  const doc = {_id: monk.id('aa'), password: 'password'};
  var users = db.get('users');
  users.insert([doc]);
  </code></pre>
  
  <p>The first commented line works, but the other lines both error out:</p>
  
  <ul>
  <li><code>_id: monk.id('aa')</code> errors out immediately</li>
  <li><code>_id: 'aa'</code> errors out when doing <code>users.insert()</code> because I guess it tries to cast the string into an Id</li>
  </ul>
  
  <p>The error is the same regardless:</p>
  
  <pre><code>Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
  </code></pre>
  
  <p>How can I use a given string for <code>_id</code>?</p>
  
  <p>ps: to run this code, you need mongo running, <code>mongod --dbpath data</code>, and nodejs: <code>npm install monk; nodejs</code>.</p>