title: How to assign a mongodb query result to a variable?
body: <p>Now I connect Node.js with mongodb and query databse using express. Say there is schema called <code>Animal</code>, which has an array field called <code>traits</code>. When I query:</p>
  
  <pre><code>db.animals.distinct("traits")
  </code></pre>
  
  <p>I got the result as:</p>
  
  <pre><code>['playful', 'funny', 'lazy', 'loyal']
  </code></pre>
  
  <p>Is it possible that I pass this result to a variable for later use? Thanks a lot.</p>