Express-Cassandra multiple value search from SET data type in same query on a single column

940 views Asked by At

In Express Cassandra, i have a method to get data from table using "contain" keyword where data type is SET now i get data from table while use single value in contain, my custom query given below

var query = {
  participants: { $contains: uuid},
  group: { $eq: 'no' },
  single: { $eq: 'yes' }
};

models.instance.Conversation.find(query,{ raw: true, allow_filtering: true }, function(err, conversation) {
    if(err) throw err;
    else console.log(conversation);     
});

Now, problem is, i need to check it by multiple value. but i don't know how it place in query. google for it but just waste my time. any one can help me. Thnaks

1

There are 1 answers

0
Dipok Chakraborty On BEST ANSWER

we can get the raw query interface from cassandra nodejs-driver using the execute_query method.

var query = "SELECT * FROM conversation WHERE participants CONTAINS '1stvalue' AND participants CONTAINS '2ndvalue' ALLOW FILTERING;";
models.instance.Conversation.execute_query(query, {}, function(err, Conversations){
    //Conversation is an array of plain objects
});