8

Meteor.users コレクションに変換を追加するにはどうすればよいですか?

試してみましUsers = new Meteor.Collection 'users'たが、コレクションが既に存在するため、Meteor が壊れます。

4

2 に答える 2

8

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!

于 2013-03-14T18:42:56.060 に答える
0

_transform を使用すると問題が発生する可能性があり、残念ながらラッパーを使用する方が安全です。

ソースと詳細: https://github.com/meteor/meteor/issues/810#issuecomment-15069258

于 2014-10-08T19:26:44.083 に答える