title: MGO/GOLANG: Struct to unmarshall a document with
body: <p>I have a Mongo schema that looks like this:</p>
  
  <pre><code>  var phoneBookSchema = Schema({
  
        user_id: {
            type: Schema.Types.ObjectId,
            ref: 'User',
            index: {
                unique : true
            },
            required: true
        },
  
        entries: {
            type: [entry],
            default: []
        },
  
        matches: {
            type: [],
            default: []
        }
  
    });
  </code></pre>
  
  <p>The array of entry documents looks like this: </p>
  
  <pre><code>  var entry = Schema({
  
          _id : false,
  
          phone: {
                type: String,
                index: true
          },
  
          name: {
                type: String
          },
  
          notified: {
                type: Boolean,
                default: false,
                required: true
          }
  
    });
  </code></pre>
  
  <p>How do I format the PhoneBook struct in Golang so that I can run a query like this and unmarshall the results into an array of PhoneBooks?</p>
  
  <pre><code>  var results []PhoneBook
  
    err = pb.Find(bson.M{}).All(&amp;results)
  </code></pre>