title: how to join table mongoose with nodejs
body: <p>I'm new in mongoDB and nodejs, and I want to join this query <code>dbconn.users_model.find({ upline: parent.userid, position: position}, function(err, me)</code> with my collections in mongoDB, I have three data collection in MongoDB, first collections is "account", second is "balance" and the last one is "users". Here's i show my own project code. I hope you guys understand, cause i'm not good at explaining something. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>dbconn.users_model.find({ upline: parent.userid, position: position}, function(err, me) {
              if (!err &amp;&amp; me.length &gt; 0){
                  var data_node = {
                      name:me[0].name,
                      userid:me[0].userid,
                      upline:me[0].upline,
                      username:me[0].username,
                      position:me[0].position,
                      _id:me[0]._id
                  };
                  if(parent.hasOwnProperty('family')){
                      data_node.family = parent.family+'-'+data_node.userid;
                  }else{
                      data_node.family = parent.userid+'-'+data_node.userid;
                  }
                  data_tree['level_'+level]['parent_'+parent.userid+'_'+position] = data_node;
                  get_item(level,data_node,function(resp_get_item){
                      return cb('');
                  });
              }
              else{
                  var data_node = {
                      name:'___add',
                      userid:parent.userid+''+position,
                      upline:parent.userid,
                      position:position
                  };
                   if(parent.hasOwnProperty('family')){
                          data_node.family = parent.family+'-'+data_node.userid;
                      }else{
                          data_node.family = parent.userid+'-'+data_node.userid;
                      }
  
                  data_tree['level_'+level]['parent_'+parent.userid+'_'+position] = data_node;
                  if(position_mapping.hasOwnProperty(''+parent.userid)){
                  }else{
                      position_mapping[''+parent.userid] = {};
                  }
                  position_mapping[''+parent.userid][''+position] = 1;
  
                  if(!(uplinelist.indexOf(myupline) &gt; -1)){
                      uplinelist.push(myupline);
                  }else{
                      uplinelist[uplinelist.indexOf(myupline)] = myupline;
                  }
  
                  return cb('');
              }
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/VuoU2.jpg" rel="nofollow noreferrer">Hover effect</a></p>
  
  <p>If it's already connected with my collection in MongoDB ("balance" and "account"), it'll show every fields in that hover display.</p>