Meteor: Publish Empty Collection for Inserting Only

I’m writing a meteor app and ran into a problem where I only need a collection reference to be able to insert new documents into it. I don’t need to read any data from the collection. I think by publishing an empty collection would save the effort in synchronizing data between the server and the client which would make the app more efficient. I couldn’t find anything helpful by Googling so I came up with something myself and so far it seems to be working just fine.

Here’s how:

(Code clip removed)

I’m simply adding a filter that’s always going to get me nothing. I guess I would never have attribute undefined defined on any documents, so that would work for me.

Hope you find this helpful. 🙂

Actually you don’t even need a subscription in order to insert, as long as the server side has the same collection defined as the client side. Didn’t know that.

Timeline – Version Control for MMO Games

When a MMO game updates with tons of great new features, some players just wish they could stay at the old version. What if whenever a new version is launched, it’s going to be a new set of server based on the current game data, a new timeline? And so players can choose to opt-in for the timeline where the new version is released, or the one where nothing happened?

This is just a rough idea. It’s something I would like to see in many games, but I know it’s going to be really hard to execute and maybe the game system needs to be specifically designed to make the timeline branching easy.