Middleware de consulta em Express

//we will create secreteTour in schema and only send tour which are not secrete using query middleware
//query middleware run before .find() and .findOne()
tourSchema.pre(/^find,function(next) {
     this.find({secretTour: {$ne: true}})
     next()
})
Sab Tech