title: How to get user name from user id in React.js
body: <p>I have created this schema with mongoose</p>
  
  <pre><code>const mongoose = require('mongoose');
  const Schema = mongoose.Schema;
  
  const QuestionSchema = new mongoose.Schema({
      user: {
          type: Schema.Types.ObjectId,
          ref: 'users'
      },
      question:{
          type:String
      },
      name:{
          type:String,
      },
      answerd:[
          {
              user:{
                  type:mongoose.Schema.Types.ObjectId,
                  ref:'users'
              }
          }
      ]
  })
  
  module.exports = Question = mongoose.model('question',QuestionSchema);
  </code></pre>
  
  <p>In my global state (REDUX) I have the state</p>
  
  <pre><code>const initialState = {
      questions:[],
      question:null,
      loading:true,
      error:{}
  };
  </code></pre>
  
  <p>The element questions store question object which contains the name of the user who made the question, the question itself, and people who have answered.</p>
  
  <p>Some where in a .js file I can get the id of users who have answered by simply
  <code>question.buzzed.map(user=&gt; &lt;h1&gt; {user._id} &lt;/h1&gt;)</code>,
  but how is possible to get this user name, I also have a schema for user which have attributes such as name, id, ... etc</p>