title: "Invalid use of aggregating function in this context" in a SET query (Neo4j)
body: <p>I wonder why this is considered an invalid use of aggregate functions in Neo4j's Cypher:</p>
  
  <pre><code>MATCH (p:Project)-[:EMPLOYS]-(n:Person) SET p.youngest = MIN(n.age);
  </code></pre>
  
  <p>While the following is considered a valid use case:</p>
  
  <pre><code>MATCH (p:Project)-[:EMPLOYS]-(n:Person) RETURN p.name, MIN(n.age) AS youngest;
  </code></pre>
  
  <p>How should I rewrite the first query to make it valid?</p>