我正在尝试查询我的 cassandra 数据库以从阵列服务器端保存的名称列表中返回数据。这被保存为一个数组。我知道我正在访问的数据作为字符串存储在我的数据库中,所以我在它周围附加了单引号(我尝试过有和没有这个但没有运气)。
这是我的查询。
const arr = ["ukcust1","ukcust2","ukcust5"];
//Here I append single quotes before and after to each string if needed
const query = "SELECT * FROM table_name WHERE name = ?";
client.execute(query, arr, { prepare:true }, function (err, result) {
..//Code
};
我在这里想念什么?我希望查询是:
SELECT * FROM table_name WHERE name = each of the names in the array 'arr';