title: NoSQL: insert an array
body: <p>I have a question in the homework assignment. </p>
  
  <p>Suppose that each actor can work in multiple movies. We want to record the names of movies for each actor as an embedded array within a document of each actor. 
  Modify the following insertion query to add the following movies as an array: Life of Pie, Madagascar, and Hunger Games. </p>
  
  <pre><code>db.actor.insert({
   first: 'matthew',
   last: 'setter',
   dob: '21/04/1978',
   gender: 'm',
   hair_colour: 'brown',
   occupation: 'developer',
   nationality: 'australian',
   height_cm: 185
  });
  </code></pre>
  
  <p>I thought it would be as easy as just adding this line into the code:</p>
  
  <pre><code>movies: ["Life of Pie", "Madagascar", "Hunger Games"]
  </code></pre>
  
  <p>but obviously, it's not that simple. I tried to find the syntax and examples for inserting an array, but had no luck. </p>