I modified the leaderboard example to use two collections:
Players = new Meteor.Collection("players");
Tasks = new Meteor.Collection("tasks");
The Players collection has the 6 documents defined in the example.
> db.players.count()
6
The Tasks collection has 48,000 documents.
> db.tasks.count()
48000
As soon as I open the browser, Node jumps to 100% CPU and the client can't see any of the tasks records.
Players.find().count()
6
Tasks.find().count()
0
I tried defining query criteria but that only works on the server and doesn't help on the client.
Players.find({name:"Claude Shannon"}).count();
1
Tasks.find({tid:"t36254"}).count();
0
I'm guessing that 48,000 documents is too much to sync. That's causing Node to peg at 100% CPU and the client to throw errors like this: http://i.imgur.com/zPcHO.png.
How do I prevent syncing everything and only retrieve specific documents from the collection?