Filter response before sending it Filter response before sending it mongoose mongoose

Filter response before sending it


You can exclude the token field in results by default via the select attribute of the field definition in the schema:

token : {  'type'      : String,  'index'     : { unique: true },  'required'  : true,  'select'    : false}