coffeescript - not able to exclude fields from Meteor collection in Houston -


i'm using houston admin section meteor app, there lot of fields don't need see. i'm thinking want avoid publishing fields mongo in first place, rather eliminate them in convoluted way in template.

here's coffeescript in houston in server/publications.coffee:

houston._publish name, (sort, filter, limit, unknown_arg) ->   check sort, match.optional(object)   check filter, match.optional(object)   check limit, match.optional(number)   check unknown_arg, match.any   return unless houston._user_is_admin @userid   try     collection.find(filter, sort: sort, limit: limit)   catch e     console.log e 

here's i've tried replace with. doesn't cause errors, doesn't stop fields showing.

houston._publish name, (sort, filter, limit, unknown_arg) ->   check sort, match.optional(object)   check filter, match.optional(object)   check limit, match.optional(number)   check unknown_arg, match.any   return  unless houston._user_is_admin(@userid)   try     return collection.find(filter,       sort: sort       limit: limit     ,       fields:         category: 0         userid: 0     )   catch e     console.log e 

i'm not sure if error in coffeescript conversion (i've double-checked indentation), or in general approach.

thanks help,

charlie magee


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -