title: Retrieve information from reference ObjectId MongoDB
body: <p>I have this scheme</p>
  <pre><code>const friendSchema = new mongoose.Schema(
    {
      friend_id: {
      type: mongoose.Schema.Types.ObjectId,
      ref: &quot;Users&quot;,
    },
       status: String,
    },
    { _id: 0 } 
  );
  </code></pre>
  <p>and this model is using it</p>
  <pre><code>const UserSchema = new mongoose.Schema({
    name: {
      type: String,
    },
    password: {
      type: String,
    },
    rate: {
      type: Number,
      default: 0,
    },
    friend: [friendSchema],
  })
  </code></pre>
  <p>just like a user having friends
  and i wanted to get every user and their friends (name - rate)</p>
  <p><strong>status</strong> in the friendSchema is the status of friend request (accepted - pending)
  i am using this code</p>
  <pre><code>let users = await User.find().select('-password').populate({ path: 'friend.$.friend_id' ,  select: 'name rate' })
  </code></pre>
  <p>when i tried with postman using this route
  i get every user and the status of friends only without the name - rate of every friend</p>
  <p>how can i get every user and the information of their friends ?</p>