title: Filtering arrays in a document or sub document in MongoDB Java
body: <p>My Java Code: </p>
  
  <pre><code>MongoCollection&lt;Document&gt; coll = mongoClient.getDatabase(dbs.get(0)).getCollection(dbc.get(2));
      Bson Myfilter=Filters.and(Filters.eq("id", "144-12"), Filters.gte("lastTimestamp",StartPeriod ),
                  Filters.lte("lastTimestamp", FinishTime));
      FindIterable&lt;Document&gt;  doc=coll.find(Myfilter).limit(5);
      for (Document Document : doc) {
          System.out.println(Document);
      }
  </code></pre>
  
  <p>for more help the corresponding Mongo Compass screenshot to  show the data structure:</p>
  
  <p><a href="https://i.stack.imgur.com/F8PFo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F8PFo.png" alt="enter image description here"></a></p>
  
  <p>and another screenshot from Mongo Compass and i have copied the JSON Document inside the red rectangle:</p>
  
  <p><a href="https://i.stack.imgur.com/x4vDI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x4vDI.png" alt="enter image description here"></a></p>
  
  <pre><code>{"_id":"5db06ab680bd68ca32a84c6e","disconnected":false,"id":"144-12","lastTimestamp":"1571842738588","manufacturer":"gmb","modelName":"GMB_Mod1","signals":[{"event":"changed","signal":"InjectionUnitCycleParametersType.DosingTime","stability":"unstable","timestamp":"1571842736566","type":"INTEGER","value":"0","writable":"read","written":false},{"event":"changed","signal":"InterfaceType.Jobs.ActiveJobValues.LastCycleTime","stability":"unstable","timestamp":"1571842736584","type":"INTEGER","value":"0","writable":"read","written":false}],"tC":10}
  </code></pre>
  
  <p>I want to try to combine the filters with array fields and scalar fields. for instance int the photo I would like to combine filters based on "manufacturer" field and "written" field of the array</p>