write mongoDB find query in java code
<p>I want to generate java code for below mongoDB query:</p>

<pre><code>db.getCollection('dum_stats').find({ "engineNo": {$eq: 1} },{"sensorName": 1, "_id": false}) 
</code></pre>

<p>Solution:</p>

<pre><code>Bson query = Filters.eq("engineNo", Integer.parseInt(machineId));
FindIterable&lt;Document&gt; listOfSensorNames = dbCollection.find(query).projection(Projections.fields(Projections.include("sensorName"), Projections.exclude("_id")));
</code></pre>