title: MongoDB, Using Mongodb ObjectID between collections
body: <p>Using PHP and MongoDB, i have a collection called users and another one called forms in the same DB.</p>
  
  <p>I am using the Mongodb ObjectID as user identifier for the documents in the forms collection, saving the users ObjectId as uid on each forms document.</p>
  
  <p>I am going to create an index of the uid field in the forms collection, but my question is how i should save the users Objectid?</p>
  
  <p>As of now I am saving it as a normal string like (simplified)</p>
  
  <pre><code>$collection-&gt;insert( array('formName'=&gt;'The name','uid'=&gt;'CURRENT_USERS_ObjectId_AS_string') );
  </code></pre>
  
  <p>Does this seem logic or is best practice in this case to create a Mongodb ObjectID for uid like</p>
  
  <pre><code>$collection-&gt;insert( array('formName'=&gt;'The name','uid'=&gt; new MongoId('CURRENT_USERS_ObjectId_AS_string')) );
  </code></pre>