2017-06-14 65 views
0

在流星我使用的是accountsGoogle包。我試圖在我的網站上使用Google個人資料圖片,但一旦刪除autopublish包,我需要發佈並訂閱用戶集合的Google部分。我會如何去做這件事?accountsGoogle發佈個人圖片

Meteor.publish('users', function(){ 
    return Meteor.user.services.google.find({}); 
}); 

回答

0

你可以使用

Meteor.user() 

獲得來自客戶端的用戶文檔或者,如果你真的想用一個出版物

Meteor.publish('users', function() { 
    return Meteor.users.find(this.userId); 
}) 
+0

'Meteor.user()'不返回用戶集合的services.google部分,除非安裝了autopublish。 – James

+0

在我的app上,autopublish被移除,Meteor.user()返回整個文檔 – tandrieu