Our first collection
Lets define our collection in both/collections/teams.js
:
Teams = new Mongo.Collection('teams');
Firstly note that we didn't write var
before Teams
. We need to do this so that the rest of the app has access to Teams as a global variable.
Secondly you can see we pass 'teams'
as a parameter. This is the name of the collection (table) that is created in Mongo. We don't really need to worry about this in our app code - we will always use the variable name 'Teams'. But later when we are peeking inside Mongo we'll need to remember that the collection is called teams
.