knex like query

Solutions on MaxInterview for knex like query by the best coders in the world

showing results for - "knex like query"
Valentina
20 Mar 2017
1const getResults = (options) => {
2    let query = knex('table');
3    if (options.where) {
4        query = query.where('franchisee_name', 'like', '%jackmarker%');
5    }
6
7    if (options.other) {
8        query = query.where('company', 'like', '%marker%');
9    }
10
11    return query.select();
12};