title: How do I get a subset of a Backbone.Collection?
body: <p>Given this collection - </p>
  
  <pre><code>{"education":
  [
      {
          "school":{
              "name":"Maxwell",
              "type":"Secondary",
              "teachers": [
                  {"name":"Mrs. Smith","subject":"Chemistry"},
                  {"name":"Mr. Jones","subject":"Calculus"}
              ]
          }
      },{
          "school":{
              "name":"Bright",
              "type":"Elementry",
              "teachers": [
                  {"name":"Mr. Anthony","subject":"Reading"},
                  {"name":"Mrs. Bates","subject":"Social Studies"}
              ]
          }
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>I am trying to return all of the school items so that I can display the names in my template.  </p>
  
  <p>Given this code - </p>
  
  <pre><code>schools = [];
  filtered = this.filter(function (item) {
          return (
                  item.get('school') !== ''
          )
  });       
  _.each(filtered, function(k,v) {
      _.each(k.attributes.models, function (k2, v2) {                 
          schools.push(k2.get('school'));
      });
  });
  colSchools = new Backbone.Collection(schools);    
  </code></pre>
  
  <p>This gets the job done, but it doesn't seem very efficient, or really the correct way to do things.</p>
  
  <p>I tried looping on <i>this</i> instead of filtered, and I get an error that <i>k is undefined</i>.  My question I guess is two part - why would that return <i>k is undefined</i> and what am I missing about grabbing the subset of the education collection?  I feel like the nested loop is excess work that doesn't need to happne.  It could be that I am misinterpreting how Backbone handles collections, or is this really the best way to achieve my goal?</p>