Node.js - where condition only works as object or inside knex function
Node.js - where condition only works as object or inside knex function
Hoi,
seems like this problem was previously discussed, but documentation on homepage needs to be updated accordingly or the problem needs a fix.
This wont work:
editor.where( 'user_id', 12 );
but the object variant works:
editor.where( {
user_id: 12
} )
The object variant doesn't allow conditions, so I have to write the function variant as follows:
editor.where( function () {
this.where( 'user_id', '>', 12 );
} );
Cheers
Hannes
Replies
Hi Hannes,
Thanks for pointing that out. It is an error on my part - apologies. I've committed the fix here.
Regards,
Allan
Hi Allan,
awesome thanks as always for the quick fix.
Cheers
Hannes