MongoDB get object id by finding on another column value
<p>I am new to querying dbs and especially mongodb.If I run :</p>

<pre><code>db.&lt;customers&gt;.find({"contact_name: Anny Hatte"}) 
</code></pre>

<p>I get:</p>

<pre><code>{ 
  "_id" : ObjectId("55f7076079cebe83d0b3cffd"), 
  "company_name" : "Gap", 
  "contact_name" : "Anny Hatte", 
  "email" : "ahatte@gmail.com" 
}
</code></pre>

<p>I wish to get the value of the "_id" attribute from this query result. How do I achieve that?</p>

<p>Similarly, if I have another collection, named items, with the following data:</p>

<pre><code>{ 
  "_id" : ObjectId("55f7076079cebe83d0b3d009"), 
  "_customer" : ObjectId("55f7076079cebe83d0b3cfda"), 
  "school" : "St. Patrick's" 
}
</code></pre>

<p>Here, the <code>"_customer"</code> field is the <code>"_id"</code> of the customer collection (the previous collection). I wish to get the <code>"_id"</code>, the <code>"_customer"</code> and the <code>"school"</code> field values for the record where <code>"_customer"</code> of items-collection equals <code>"_id"</code> of customers-collection.</p>

<p>How do I go about this?</p>