title: Referencing User Schema inside a User schema (and using the populate method with it)? Mongoose
body: <p>I am trying to create an application using mongoose. I have a User Schema. User's can follow other Users (similar to how Twitter or Instagram work.</p>
  
  <p>Here is my UserSchema:</p>
  
  <pre><code>let UserSchema = new Schema({
      email: {
          type: String,
          required: true,
          unique: true,
      },
      username: {
          type: String,
          required: true,
          unique: true,
      },
      password: {
          type: String
      },
      following: {
          type: [Schema.Types.ObjectId],
          ref: 'User'
      },
      followers: {
          type: [Schema.Types.ObjectId],
          ref: 'User'
      }
  })
  </code></pre>
  
  <p>I am trying to create a route that will display a user's follower's  and following information, such as their name and id. So, I tried something like this:</p>
  
  <pre><code>User.findOne({ _id: req.session.user }).populate('follower',['username']).then((user) =&gt; {
          res.send(user);
      })
  </code></pre>
  
  <p>However, the json that is being returned is: </p>
  
  <pre><code>   {
        "_id":"5a1dec7280a69b417a170e92",
        "username":"vegeta",
        "email":"vegeta@gmail.com",
        "__v":0,
        "followers":[
           "5a1dec7280a69b417a170e92",
           "5a1dedb9a88aad42cad87dde"
        ],
        "following":[
           "5a1dec7280a69b417a170e92",
           "5a1dedb9a88aad42cad87dde"
        ],
        "password":"$2a$10$ZsEpC6LoE0I.FzsTtPo2IOBICRGoYsFV0s2RVNcCW/g9VO4ErGaKW"
     }
  </code></pre>
  
  <p>Instead, I would like to see information about the follower and following so, something like:</p>
  
  <pre><code>   {
        "_id":"5a1dec7280a69b417a170e92",
        "username":"vegeta",
        "email":"vegeta@gmail.com",
        "__v":0,
        "followers":[
           {
              _id: "5a1dec7280a69b417a170e92",
              username: "vegeta"
           },
           {
              _id: "5a1dedb9a88aad42cad87dde",
              username: "goku"
           }
        ],
        "following":[
           {
              _id: "5a1dec7280a69b417a170e92",
              username: "vegeta"
           },
           {
              _id: "5a1dedb9a88aad42cad87dde",
              username: "goku"
           }
        ],
        "password":"$2a$10$ZsEpC6LoE0I.FzsTtPo2IOBICRGoYsFV0s2RVNcCW/g9VO4ErGaKW"
     }
  </code></pre>
  
  <p>How can I fix my User.findOne method to solve my issue?</p>