I used the latest demonstration, Parties which includes exactly the code you are looking for. Check out how a user can create a Party. The examples are very good.
You are able to pull the application, and view the code by running:
meteor create --example parties
Specifically focus on the model.js file:
createParty: function (options) {
options = options || {};
throw new Meteor.Error(400, "Required parameter missing");
if (options.title.length > 100)
throw new Meteor.Error(413, "Title too long");
if (options.description.length > 1000)
throw new Meteor.Error(413, "Description too long");
if (! this.userId)
throw new Meteor.Error(403, "You must be logged in");
return Parties.insert({
owner: this.userId,
title: options.title,
description: options.description,
});
You'll need a good IDE to follow how each of the methods are called. I use Sublime Text2 to search for instances of "createParty" and so on. You can pull the application apart; Try to see if you can add additional fields to the party app to test your knowledge. Bring your own beer checkbox?
Focus your reading on Meteor.methods, Meteor.publish, Meteor.subscribe in the Meteor Docs. Template events really helped me out too.