title: How to get the total count of a Meteor collection with a limit set?
body: <p>In my meteor app, I'm doing infinite scrolling so I must have a limit set on my subscriptions in order to achieve this, but I also need to show the total count from that same collection and update it if the count changes.  How would I achieve that?</p>
  
  <p>I have a partial solution that achieves this but only returns the paginated counts, as follows:</p>
  
  <pre><code>function getTotalCount(system) {
      var user = Meteor.user(),
          queryObject = getSystemQueryObject(system);
      if (queryObject) {
          var query = queryObject.find({$and: [
              {user: user.username},
              {status: {$nin: status_complete}}
          ]});
  
          var count = 0;
  
          var handle = query.observeChanges({
              added: function (id, user) {
                  $('#' + system + 'Count').text(++count);
                  $('#' + system + 'Count').addClass("ma-count-badge");
                  console.log(system + " count incremented: " + count);
              },
              removed: function () {
                  $('#' + system + 'Count').text(--count);
                  $('#' + system + 'Count').addClass("ma-count-badge");
                  console.log(system + " count decremented: " + count);
              }
          });
      }
      else {
          return 0;
      }
  }
  </code></pre>
  
  <p>The other way is to push this method up to the server as a server method, but then it is not reactive, as follows:</p>
  
  <pre><code>    Meteor.call('getSystemsTotalCount', system, function (err, counted) {
          if (err) {
              throw err;
          }
          if (counted &gt; 0) {
              $('#' + system + 'Count').text(counted);
              $('#' + system + 'Count').addClass("ma-count-badge");
          }
          Session.get('listLimit');
      });
      }
  </code></pre>