feathersjs-ecosystem / feathers-objection

Feathers database adapter for Objection.js, an ORM based on KnexJS SQL query builder for Postgres, Redshift, MSSQL, MySQL, MariaDB, SQLite3, and Oracle. Forked from feathers-knex.
MIT License
98 stars 49 forks source link

syntax for whereNotIn for mysql while building query in objection Js #158

Open tusharSharma5512 opened 3 years ago

tusharSharma5512 commented 3 years ago

i want to find rows from table 1 which does not exist in table 2. depending on two columns. I'm trying to build a query in objection js but not getting the required answer. and the entries are same but column names are different. Here is my query :- let miniShift = await createModel.query() .select('txnShiftUniqueId', 'shiftName', 'laneName', 'txnDate', 'txnShiftDetail.uidCby') .leftJoin('mstShift', 'mstShift.shiftId', 'txnShiftDetail.shiftId') .leftJoin('pmtrLane', 'pmtrLane.isEnabled', 'txnShiftDetail.isEnabled') .whereNotIn('txnShiftDetail.shiftId', ['txnCashup']) .whereNotIn('txnShiftDetail.laneId', ['txnCashup']) .whereNotIn('txnShiftDetail.uidCby', ['txnCashup'])