node.js - Strongloop querying data with (or) and (and) at the same time -


i need this.

select *  person  (firstname '%a' or lastname "%a") , id not in (1 , 2)  

node.js:

   begroupduser.find({         limit: limit,         skip: skip,         where: {             id: { nin: adminids },             or: [{                 firstname: {like: '%' + _query + '%'}             }, {                 lastname: {like: '%' + _query + '%'}             }]         }     }, function (errors, users) {   }); 

try this

{   "where": {     "and": [       {         "id": {           "nin":  adminids         }       },       {         "or": [{                 firstname: {like: '%' + _query + '%'}},                  {                 lastname: {like: '%' + _query + '%'}}               ]       }     ]   } } 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -