title: Creating new Meteor collections on the fly
body: <p>Is it possible to create new Meteor collections on-the-fly? I'd like to create <code>foo_bar</code> or <code>bar_bar</code> depending on some pathname which should be a global variable I suppose (so I can access it throughout my whole application).<br>
  Something like:</p>
  
  <pre><code>var prefix = window.location.pathname.replace(/^\/([^\/]*).*$/, '$1');
  var Bar = new Meteor.Collection(prefix+'_bar');
  </code></pre>
  
  <p>The thing here is that I should get my <code>prefix</code> variable from URL, so if i declare it outside of <code>if (Meteor.isClient)</code> I get an error: <code>ReferenceError: window is not defined</code>. Is it possible to do something like that at all?</p>
  
  <p><strong>Edit</strong> :  Using the first iteration of Akshats answer my project js : <a href="http://pastie.org/6411287" rel="nofollow">http://pastie.org/6411287</a></p>