title: What is the proper way to check if a user has liked a thread when he GET the thread?
body: <p>I am implementing a <code>like</code> feature, the user can like and unlike a thread.</p>
  
  <pre><code>The thread model is like this:
  
  const ThreadSchema = new mongoose.Schema({
      author: {
          id: { type: ObjectID, required: true, ref: 'User' },
          screen_name: { type: String, required: true },
          picture: { type: String, required: true },
      },
      theme: { type: String },
      text: { type: String, required: true },
      comments: {
          count: { type: Number, default: 0 },
      },
      likes: {
          count: { type: Number, default: 0 },
          users: [{
              _id: false,
              id: { type: ObjectID, required: true, ref: 'User' },
              screen_name: { type: String, required: true },
              picture: { type: String, required: true },
          }],
      },
  }, {
      timestamps: true,
  });
  </code></pre>
  
  <p>Something tricky is that when the user sends the request to get the thread information, I need to tell the client whether this user has liked this thread before or not.</p>
  
  <p>Does that mean that every time when the client sends a request to get the thread, I need to loop through <code>thread.likes.users</code> to find whether his ID is there? This check seems pretty heavy especially when the user tries to retrieve a list...</p>
  
  <p>Any better solution for this?</p>
  
  <p>The requirement is simple, just before the user even clicks the <code>like</code> button, the state should already there to indicate if this thread has been liked by this user or not.</p>