Couchbase dynamic condition in query view

154 Views Asked by At

What is solution for dynamic SQL we generate in Couchbase View creation, for instance consider a filter form which has all fields that user can filter ( customer name, tel, address, state,...) in sql world I would generate a dynamic sql condition part by fields that user has filled out.

    select *
    from x
    where [condition1] and [condition2] and [condition3]

conditions are optional and will be concatenate in runtime. consider the number of options is predefined for example there are only 3 options which can participate in condition part and options are not infinite.

what is the best solution for these kind of situation in Couchbase world and map/reduce technique?

We are working on couchbase mobile and mainly our focus is on android, if we create a view for each condition and get a list for each condition then try to intersection all common items in all lists, i think this would cause performance problems.

0

There are 0 best solutions below