0

我正在通过 cqlsh 执行以下查询。

select id,user_id,company_id from feed_by_user where feed_Status='active' and company_id=9592996b-495e-4b91-b29c-8c8b6213fbce and user_id in (ca7c7b34-a0e4-4dc8-a4f7-6bb249bcc0cd) allow filtering;

我得到了预期的输出。

在尝试使用 node.js 和 express-cassandra 驱动程序执行相同的查询时,我得到:

IN predicates on non-primary-key columns (user_id) is not yet supported

我的 node.js 代码如下:

Cassandra.instance.FeedByUser.find({
    feed_status: 'active',
    company_id: company_id,
    user_id: { '$in': user_ids }
},
    { raw: true, allow_filtering: true },
    (err, feed) => {
        console.log("err >>> : ", err)
        if (err) {
            logger.error(METHOD_NAME, "Error while fetching active feed data from db")
            return callback(false)
        } else {
            logger.info(METHOD_NAME + " : executed in " + (new Date() - startTime) + "ms")
            return callback(null, feed)
        }
    })

这是我正在使用的驱动程序的问题,还是有任何解决方法可以执行此查询?

4

0 回答 0