Skip to content

Instantly share code, notes, and snippets.

@mrw34
Created April 2, 2014 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrw34/9936336 to your computer and use it in GitHub Desktop.
Save mrw34/9936336 to your computer and use it in GitHub Desktop.
meteor-with
<body>
{{> hello}}
</body>
<template name="hello">
{{#with people}}
{{count}}
{{/with}}
</template>
People = new Meteor.Collection('people');
if (Meteor.isClient) {
Template.hello.people = function() {
return People.find();
};
}
if (Meteor.isServer) {
if (!People.findOne()) {
People.insert({name: 'Joe'});
}
}
@serkandurusoy
Copy link

This should not work since count is not a property of people. Also, people is a cursor so if there is more than one document, it will be vague what to expect of count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment