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
Post a Comment