Waterline default query condition
问题 How can I set the default where/sort condition in my SailsJS waterline model? In Rails I would use default scope. 回答1: Sails doesn't support default criteria on a per-model basis, but if you're using blueprint routes you can set default criteria for the route by overriding in your config/routes.js file, for example: "GET /user": { controller: 'user', action: 'find', where: {'deleted': false}, sort: 'age DESC' } This will work even if you don't have a find action defined in your UserController