Closed dpkcse closed 6 years ago
@dpkcse AFAIK, cassandra does not support OR relations in CONTAINS and CONTAINS_KEY operations for indexed collections. Otherwise please let me know your corresponding cql query that you wanna perform here.
https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
Thanks for your reply. i got my solution already and know this rules but using AND i can set multiple value in CONTAINS and use execute_query() method for raw query instead of find().
var query = "SELECT * FROM Person WHERE col CONTAINS ? AND participants CONTAINS ? ALLOW FILTERING"; var params = [val1,val2]; models.instance.Person.execute_query(query, params, function(err, people){ //people is an array of plain objects });
@dpkcse As I can see from your query, you actually want contains on different columns not on the same column. To do that you should be able to use find like the following:
//Find all persons where my_set contains my_value
models.instance.Person.find({
col: {$contains: val1},
participants: {$contains: val2},
}, {raw: true}, function(err, people){
});
need to set multiple value in contains for custom query now allowed only single value.