title: socket emit to only one user
body: <p>I´ve been searching for the anwser but most of them i cant quite connect with my code so im hoping to get some help.</p>
  
  <p>I want to send a message for a specific user, like a chat beetween 2 people.</p>
  
  <p>For example, if i choose John how can i only send a mensage to him? im having much trouble in this</p>
  
  <p><a href="https://i.stack.imgur.com/nb66p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nb66p.png" alt="enter image description here"></a></p>
  
  <p>app.js</p>
  
  <pre><code>io.on('connection', function (socket) { 
    socket.on('chat', function (data) {
        console.log(data);
  
        //Specific user
        //socket.broadcast.to(socketid).emit('message', 'Hello');
  
    });
  });
  </code></pre>
  
  <p>I have a mongodb database so how can i specify the socketid having the user id of the select user?</p>