title: Spring Data MongoDB: How do I represent $eq in project aggregation query?
body: <p>I'm trying to convert this javascript code into java code to be used in Spring Data:</p>
  
  <pre><code>proj3={"$project": {
          "comms" : 1,
          "same" : { "$eq" : ["$comms.i" , "$max"]},
      "max" : 1,
      "_id" : 1
       }
  };
  </code></pre>
  
  <p>I cannot seem to figure it out.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>    BasicDBObject o3 = new BasicDBObject();
      o3.append("$eq", "[\"$comms.i\",\"$max\"]");
      Aggregation aggCount2 = newAggregation(project("comms", "max", "_id").andExpression("same", o3));
      logger.info(aggCount2.toString());
  </code></pre>
  
  <p>This is what is logged: </p>
  
  <pre><code>{ "$project" : { "comms" : 1 , "max" : 1 , "_id" : 1}}
  </code></pre>
  
  <p>I also read this thread: <a href="https://stackoverflow.com/questions/27080374/spring-data-mongodb-eq-within-project-support">Spring Data MongoDB - $eq within $project support</a> but the poster seemed to have given up and used the executeCommand option instead which is not the route I would like to go.</p>
  
  <p>How can I get this code to work in java Spring Data Mongodb?</p>