title: Maximum call stack size exceeded with 2 Collection.find
body: <p>I'm using Angular2 and Meteor. I have an exception(Maximum call stack size exceeded) in my Chrome console since I added that code in my client side:</p>
  
  <pre><code>var userChannelsId = UserChannels.find({idUser: Meteor.userId()});
  this.channels = Channels.find({_id: {$in: userChannelsId}});
  </code></pre>
  
  <p>From what I found, this exception occurs when there is an infinite loop. I'm sure the error comes from this lines (I debugged my code until I was sure).
  Is the problem coming from the fact that the first search isn't finished when the second begin ?</p>
  
  <p>All function :</p>
  
  <pre><code>getChannelList(): void {
      console.log('ok');
      var userChannelsId = UserChannels.find({idUser: Meteor.userId()});
      this.channels = Channels.find({_id: {$in: userChannelsId}});
      console.log('ko');
  
      this.channels.subscribe(channel =&gt; {
          this.selectChannel(channel[0]);
      });
  } 
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>As @MichaelSolati I tried to get only the IdChannel of the userChannel, but I still have the same error ... It returns an observable and not an array. Maybe it's the problem? This is what I did:</p>
  
  <pre><code>getChannelList(): void {
      console.log('ok');
      let userId = Meteor.userId();
      var userChannelsId = UserChannels.find({idUser: userId});
      var values = userChannelsId.map((userChannels:Array&lt;UserChannel&gt;) =&gt; {
          let result:Array&lt;String&gt; = [];
          if (userChannels) {
              userChannels.forEach((userChan) =&gt; {
                  result.push(userChan.idChannel);
              });
          }
          return result;
      });
      this.channels = Channels.find({_id: {$in: values}});
      console.log('ko');
      this.channels.subscribe(channel =&gt; { this.selectChannel(channel[0]); });
  }
  </code></pre>