Last active
January 15, 2016 12:50
-
-
Save johanbrook/a347c2b65a0c7c76237d to your computer and use it in GitHub Desktop.
Revisions
-
johanbrook revised this gist
Jan 15, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Meteor.publish('nightclub', (nightClubId) => { check(nightClubId, String); const clubFields = {name: 1, managers: 1}; const managerFields = {profile: 1, emails: 1}; const clubCursor = Nightclubs.find(nightClubId, {limit: 1, fields: clubFields}); const managerIds = _.pluck(clubCursor.fetch(), 'managers'); -
johanbrook revised this gist
Jan 15, 2016 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,13 @@ Meteor.publish('nightclub', (nightClubId) => { check(nightClubId, String); const clubFields = {name: 1, managers: 1}; const managerFields : {profile: 1, emails: 1}; const clubCursor = Nightclubs.find(nightClubId, {limit: 1, fields: clubFields}); const managerIds = _.pluck(clubCursor.fetch(), 'managers'); const managersCursor = Meteor.users.find({_id: {$in: managerIds}}, {fields: managerFields}); return [clubCursor, managersCursor]; }); -
johanbrook created this gist
Jan 15, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ Meteor.publish('nightclub', (nightClubId) => { check(nightClubId, String); const clubCursor = Nightclubs.find(nightClubId, {limit: 1}); const managerIds = _.pluck(clubCursor.fetch(), 'managers'); const managersCursor = Meteor.users.find({_id: {$in: managerIds}}); return [clubCursor, managersCursor]; });