title: MongoDB: Querying layers of objects and arrays
body: <p>I am very much a beginner in NoSQL.  can someone help me with the query that would find all of the documents that are "Point" geojson types in my collection?</p>
  
  <p>Here is an example document:</p>
  
  <pre><code>    {
      "_id" : ObjectId("5886276637ccefbcc5c84db2"),
      "docId" : "10bc70fb2d709f7f51b6a2cae363c8f46786fb113bc6165fb0d45e24086197fd",
      "entities" : [ 
          {
              "geoJson" : {
                  "type" : "Point",
                  "coordinates" : [ 
                      "16.44184", 
                      "100.34879"
                  ]
              },
              "isNormalised" : false,
              "confidence" : 1.0,
              "externalId" : "1ee5f6e691a43e0f34b65f9c95b4443dc9809c496d9c825f251c9883e4bf5e28",
              "end" : 2746,
              "subType" : null,
              "type" : "Location",
              "begin" : 2740,
              "value" : "Pichit"
          }
      ]
  }
  </code></pre>
  
  <p>and in Robomongo visual:</p>
  
  <p><a href="https://i.stack.imgur.com/BL5Zc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BL5Zc.png" alt="Robomongo screenshot of document"></a></p>
  
  <p>I am getting lost because of the array (entities) of objects (0) which have objects (geoJson) which have elements (type).  I have read the following and while they the answers on them make sense to me, I can't seem to fix my confusion on my example.</p>
  
  <p><a href="https://stackoverflow.com/questions/11638224/mongo-db-querying-nested-array-and-objects">Mongo db - Querying nested array and objects</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12629692/querying-an-array-of-arrays-in-mongodb">Querying an array of arrays in MongoDB</a></p>
  
  <p>What query do I need and can you elaborate the explanation of each level?</p>
  
  <p>Just to be clear the entities array can have any number of objects so the query needs to check all objects in that array, not just "0" as i nthe example image below:</p>
  
  <p><a href="https://i.stack.imgur.com/aTJ67.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aTJ67.png" alt="Example with multiple objects in the array"></a></p>