Generating ID locally to avoid auto creation by mongodb
<p>Is there a way to generate an ID for a new document?</p>

<p>Something like</p>

<pre><code>var newID = mongoose.Types.ObjectId();

// some random code that may involve db operations.

db.Model.create({_id: newID, otherProperties: {}})
</code></pre>

<p>When I write something like this, actual ID of the created document is always slightly larger than the newID. Is there anyway to use the newID exactly?</p>