Node.js 如何在knex的where子句中使用值数组?

Node.js 如何在knex的where子句中使用值数组?,node.js,express,Node.js,Express,如何在where子句中使用值数组进行比较,如下面的代码中所示,“frompersons”是响应第一次调用的名称数组,我想从“chatterusers”数据库中获取它们的信息。但是如何在下一个where子句中使用这个数组呢 return knex('frndrqst').where({ toperson: toperson }) .select('fromperson') .then(frompersons => {

如何在where子句中使用值数组进行比较,如下面的代码中所示,“frompersons”是响应第一次调用的名称数组,我想从“chatterusers”数据库中获取它们的信息。但是如何在下一个where子句中使用这个数组呢

return knex('frndrqst').where({ toperson: toperson })
            .select('fromperson')
            .then(frompersons => {

                  db.select('*').from('chatterusers')
                    .where( 'name', '=', frompersons )
                    .then(data => {
                        res.json(data);
                    })
                    .catch(err => res.json("Unable to load frndrqsts !!!"))
                })
            .catch(err => res.json("Unable to load frndrqsts !!!"))
输出:

select * from chatterusers where name in (select name from fromperson)
select * from chatterusers where name in (select name from fromperson)