Meteor.users コレクションに変換を追加するにはどうすればよいですか?
試してみましUsers = new Meteor.Collection 'users'
たが、コレクションが既に存在するため、Meteor が壊れます。
Meteor.users コレクションに変換を追加するにはどうすればよいですか?
試してみましUsers = new Meteor.Collection 'users'
たが、コレクションが既に存在するため、Meteor が壊れます。
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!
_transform を使用すると問題が発生する可能性があり、残念ながらラッパーを使用する方が安全です。
ソースと詳細: https://github.com/meteor/meteor/issues/810#issuecomment-15069258