Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you add a transform to the Meteor.users Collection?

Tags:

meteor

How do you add a transform to the Meteor.users Collection?

I've tried: Users = new Meteor.Collection 'users' but this breaks Meteor since the collection already exists.

like image 809
georgedyer Avatar asked Mar 14 '13 18:03

georgedyer


1 Answers

I figured out how to hack it at least.

There is a _transform property attached to the Meteor.users collection just like all the other collections.

Just do:

Meteor.users._transform = function(user) { 
  // attach methods, instantiate a user class, etc.
  // return the object
} 

to hook it up! Cool!

like image 138
georgedyer Avatar answered Nov 14 '22 00:11

georgedyer