我想查询以p开头的所有名称(不区分大小写)。 下面是查询对象,Organization是我生成的lb-service名称
query = {
filter: {
order: 'updatedAt ASC',
where: {name: {ilike: 'P%'}}
};
Organisation.find({filter: query.filter})
答案 0 :(得分:0)
您可以使用regex。
Organisation.find({name: {$regex: new RegExp('^P$', "i")}}).sort('updatedAt').all(function(res) {
//Do your action here..
});