title: Meteor publish/subscribe strategies for unique client-side collections
body: <p>Using Meteor, I'm wondering how best to handle different client-side collections that share the same server-side database collection.  Consider the following example: I have a <code>User</code> collection, and on my client-side I have a <em>list of users that are friends</em> and I have a search feature that performs a query on the entire users database, returning a <em>list of usernames that match the query</em>. </p>
  
  <p>On the Publish server-side method, I have two queries against the same collection that return different sets of documents. Should this data go into two separate collections on the client-side? Or should all of the User documents that match both queries end up in the same collection? If the latter, would I then duplicate code used for both the server-side and client-side query? </p>
  
  <p>On the server: </p>
  
  <pre><code>Meteor.publish('searchResults', function(query){
    var re = new RegExp(query, 'i')
    return Users.find({ 'name' : {$regex: re}})
  })
  </code></pre>
  
  <p>On the client: </p>
  
  <pre><code>Session.set('searchQuery', null)
  
  Meteor.autosubscribe(function(){
    Meteor.subscribe('searchResults', Session.get('searchQuery'))
  })
  
  Template.search.events = {
    'keyup #user-search' : function(e){
      Session.set('searchQuery', e.target.value)
    }
  }
  
  _.extend(Template.search, {
  
    searchResults: function() {
      var re = new RegExp(Session.get('searchQuery'), 'i')
      return Users.find({ 'name' : {$regex: re}})
    }
  })
  </code></pre>
  
  <p>This seems like a plausible solution, but not an optimal one. What if I wanted to create a new client-side collection that consisted of search results from multiple server-side Collections? </p>