Wanted to use like query in lbservices for angular

351 Views Asked by At

I want to query all the names starting with p (case insensitive). Below is the query object and Organisation is my generated lb-service name

 query = {
            filter: {

                order: 'updatedAt ASC',
                where: {name: {ilike: 'P%'}}
            };
Organisation.find({filter: query.filter})
1

There are 1 best solutions below

0
On

You can use regex for this.

Organisation.find({name: {$regex: new RegExp('^P$', "i")}}).sort('updatedAt').all(function(res) {
  //Do your action here..
});