// okay to subscribe (and possibly receive data) before declaring
// the client collection that will hold it.
If the client calls Meteor.subscribe(âplayersâ), but there is no corresponding collection on the client , e.g. this has not been done on the client or inside a /both directory :
var players = new Mongo.Collection(âplayersâ);
where does the data go? Is there an accessible object or API the client can use to access this data, and/or ddp messages for the subscription ? Or, is the only way via a Mongo.Collection object ?
Docs also say :
Meteor will queue incoming records until you declare the
Mongo.Collection on the client with the matching
collection name.
Does that mean the subscription data is not sent to the client until the client Mongo Collection is declared ?
My question is more about the behavior of a subscription/publication when there is no corresponding client-side collection. Let me see if I can clarify a little better.
on server only :
Players = new Mongo.Collection(âplayersâ);
Meteor.publish(âplayersâ);
on client only :
Meteor.subscribe(âplayersâ); no client collection which corresponds to this subscription/publication
Are these queued records only on the server, or are they sent to the client ? Can they be accessed in some way ?
I did a test and it looks like the DDP messages do get sent down when you call Meteor.subscribe(âCollectionNameâ) whether or not you have declared a collection on the client.
whatâs interesting is if you subscribe, then later declare the collection on the client, the collection will be populated with the queued records. This means there is some central store on the client independent of Mongo.Collection instances, I wonder what it is?
@ajaxsoap thanks. Use case is to try Redux without using minimongo. I think I can use a DDP client for that, I doubt the âheadless collectionâ client queue thing would be much good for my use case, but who knows, maybe it is. For now itâs got me just generally interested.