title: Aggregation $cond if condition implementation in Java
body: <p>I nedded to implement 'if condition'in java i don't know how to do that,So give some suggestion  to that</p>
  
  <pre><code>db.test.aggregate(
         [
            {
               $project:
                 {
                   data: 1,
                   result:
                     {
                       $cond: { if: { $cond: [ "$salary", 250000 ] }, then: 30, else: 20 }
                     }
                 }
            }
         ]
      )
  </code></pre>