Tag Archive for meteor

Sorting collections in Meteor.js

I was surprised to find that it was trickier than I expected to find a good example of sorting my collection queries in meteor.js. It’s not hard, but the syntax was different than most of the MongoDB examples I was looking at. Here’s a sample format:

Template.myTemplate.gizmos = function () {
  return Gizmos.find({}, {sort: [[ name: "asc" ]]});
};

You can also accomplish the same thing like so:

Template.myTemplate.gizmos = function () {
  return Gizmos.find({}, {sort: { name: 1 }});
};

Meteor + Firefox + Cookie settings = SecurityError

I first noticed these symptoms last week, and had this in the back of my mind to track down. I deployed our Meteor app to an internal server last week, and started having problems with Firefox. Firefox is still my default browser (yes, I’ve heard ALL THE THINGS about Chrome, but I haven’t changed), so it was a little sad to discover that my app didn’t work. In particular, my first page ended up being completely blank because a JavaScript exception was being thrown and no rendering was taking place.

Looking into the JavaScript log, I found this error:

SecurityError? The operation is insecure? Wuh?

Read more