title: update use notifications live with socket.io
body: <p>hello i'm trying to use socket io to get user notification from db.
   here is how i'm trying to get data and send them back to user</p>
  
  <pre><code>    if(req.user) {
      req.io.sockets.on('connection', function(socket){
      setInterval(getNotf,1000)
      function getNotf() {
      User.findOne({email:req.user.email})
      .then(user=&gt;{
          messages=(user.notifications);
          console.log(messages)
                     socket.emit('output', messages);
  });
      }  
  
  });
  </code></pre>
  
  <p>}
  the problem with that way is that the message sent to all connected users.how can i send them only to the current user?</p>