Some of my collections are declared like this
export default Foos = new Meteor.Collection('foo', {
transform(foo) {
foo.someMethod = someMethod;
return foo;
}
});
How do I apply a transformation function to the Meteor.users collection?
Update
My hack, currently, is to manually set it.
Meteor.users._transform = function (user) { ... return user; }
Seems to work.
I see you already figured out how to add the
transformfunction, but there is one more thing you should do. That is to wrap your function withLocalCollection.wrapTransformprior to assigning it to_transform:Doing this will make sure the returned objects contain the
_idfield so that subsystems can keep track of the objects identities. Also you need to addminimongoto your project to use this wrap function.