Created
December 9, 2015 16:19
-
-
Save ericterpstra/97070f8b5a1f73301dd0 to your computer and use it in GitHub Desktop.
meteor transform in pub
This file contains 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 characters
Meteor.publish('pubname', function(doTransform) { | |
let options = {}; | |
if (doTransform) { | |
options.transform = function(doc) { | |
doc.username = 'johndoe'; | |
} | |
} else { | |
options.transform = null; | |
} | |
return MyCollection.find({},options); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment