Search code examples
sqlnosqlibm-cloudcloudant

How to create a Cloudant Query with arithmetic operations


I need to collect documents inside this Cloudant database I have where the sum of two properties equals something else.

In SQL, I would perform some like this

select * from table where property1 + property2 > 20;

And it would sucessfully bring all results that match this operation.

How do I perform a similar search comparing the value of two properties in a Cloudant query?


Solution

  • I don't think mango-style queries provide the functionality to do such arithmetic expressions. I suggest taking a look at regular views. You might even want to use show functions for updating the constant interactively.