title: Adding a Static, Complex Object to Mongoose/Passport Schema
body: <p>I use Mongoose and Passport in my web application for the addition of new users into my MongoDB database. I use Google oauth for registering/signing in. In my user schema, I have the following defined for the google method:</p>
  
  <pre><code>//user.js
      var userSchema = mongoose.Schema({
  
          google           : {
              id           : String,
              token        : String,
              access_token : String,
              email        : String,
              name         : String,
              picture      : String,
              nameInfo     : Object,
          }
      });
  </code></pre>
  
  <p>I use the following method for user creation:</p>
  
  <pre><code>//passport.js
  var newUser          = new User();
  
                      //newUser.google.token = token;
                      newUser.google.name  = profile.displayName;
                      newUser.google.nameInfo = profile._json.name
                      newUser.google.email = profile.emails[0].value;
                      newUser.google.id = profile.id;
                      newUser.google.picture = profile._json.image.url + '0';
                      newUser.google.access_token = token;
  </code></pre>
  
  <p>You can see that all this data goes under the "google" array in the top level of my user document. How would I add a new, complex, static array? For example, I want a new array at the top level of document in the following format:</p>
  
  <pre><code>newUser.dogs = ["cats":[]}]
  </code></pre>
  
  <p>I need this particular format based on a dependency in how users should look in my web code. I will eventually be adding data to the "cats" array, but it needs to start out empty. When I try varations of this, I'm only able to get the top level array - ex: my document looks like:</p>
  
  <pre><code>objectid: 1000,
  google: [...],
  dogs: []
  </code></pre>
  
  <p>when I need it to look like:</p>
  
  <pre><code>objectid: 1000,
  google: [...],
  dogs: [{"cats":[]}]
  </code></pre>
  
  <p>What do I need to change to my schema, either on the schema design, or the data going into the schema?</p>