title: Convert the aggregation query of mongodb for spring boot
body: <p>I have a mongodb query which works fine</p>
  <pre><code>db.user.aggregate([
    {
      &quot;$project&quot;: {
        &quot;data&quot;: {
          &quot;$objectToArray&quot;: &quot;$$ROOT&quot;
        }
      }
    },
    {
      $unwind: &quot;$data&quot;
    },
    {
      &quot;$match&quot;: {
        &quot;data.v&quot;: {
          $regex: &quot;Mohit Chandani&quot;
        }
      }
    }
  ])
  </code></pre>
  <p>It basically, get all the document having the value Mohit Chandani and here is the output:</p>
  <pre><code>{ &quot;_id&quot; : &quot;b387d728-1feb-45b6-bdec-dafdf22685e2&quot;, &quot;data&quot; : { &quot;k&quot; : &quot;fullName&quot;, &quot;v&quot; : &quot;Mohit Chandani&quot; } }
  { &quot;_id&quot; : &quot;8e35c497-4296-4ad9-8af6-9187dc0344f7&quot;, &quot;data&quot; : { &quot;k&quot; : &quot;fullName&quot;, &quot;v&quot; : &quot;Mohit Chandani&quot; } }
  { &quot;_id&quot; : &quot;c38b6767-6665-46b8-bd29-645c41d03850&quot;, &quot;data&quot; : { &quot;k&quot; : &quot;fullName&quot;, &quot;v&quot; : &quot;Mohit Chandani&quot; } }
  </code></pre>
  <p>I need this query to be converted for my spring boot application and I am writing the following:-</p>
  <pre><code>Aggregation aggregation = Aggregation.newAggregation(Aggregation.project(Aggregation.ROOT), Aggregation.match(Criteria.where(connectionRequest.getWord())));
  </code></pre>
  <p>It would be helpful to know which approach to take when you do long aggregations in Spring-Data.</p>