Node.js 在帆上找到相等且相似的()
我想执行这样的查询Node.js 在帆上找到相等且相似的(),node.js,sails.js,waterline,Node.js,Sails.js,Waterline,我想执行这样的查询 select * from user where user.status = 'ban' and user.status = 'new' and user.username like 'fo%' // in code I will get this from req.param('user') var username = req.param('user'); var status = req.param('status'); User.find().where({ sta
select * from user where user.status = 'ban' and
user.status = 'new' and
user.username like 'fo%' // in code I will get this from req.param('user')
var username = req.param('user');
var status = req.param('status');
User.find().where({ status : [status, 'new'], username : username }).exec(function(err, users){
console.log(users);
});
我知道该怎么做
select * from user where user.status = 'ban' and
user.status = 'new' and
user.username like 'fo%' // in code I will get this from req.param('user')
var username = req.param('user');
var status = req.param('status');
User.find().where({ status : [status, 'new'], username : username }).exec(function(err, users){
console.log(users);
});
但是我不知道如何使用“like”作为用户名
我该怎么办。
谢谢
试试看
为了便于参考,这里有一个关于水线查询格式的文档链接