NO SQL Storage - how to use multiple operator Query search

0 votes

NO SQL Storage.

I was trying to create a query with multipel conditions like 

NAME = "SAM"   AND (AGE = 15 OR AGE = 16 OR AGE = 25)

How can I do this to retrieve from the cloud and how to continue with below :

Query q1 ="NAME", "SAM", Operator.EQUALS); 
    Query q2 ="AGE", 15, Operator.EQUALS);
    Query query = QueryBuilder.compoundOperator(q1, Operator.AND, q2);  
hwo how to add the remaining Ages too into the same query ? 
asked Sep 1, 2015 in App42 Cloud API-BaaS by jingahr (24 points)

1 Answer

+1 vote



Please find a below code snippet to make a query on multiple values and let me know if it helps:

Query q1 ="Age", 15, Operator.EQUALS);
Query q2 ="Age", 16, Operator.EQUALS);
Query q3 ="Age", 25, Operator.EQUALS);
Query q4 ="Name", "Sam", Operator.EQUALS);
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);
query = QueryBuilder.compoundOperator(q3, Operator.OR, query);
query = QueryBuilder.compoundOperator(q4, Operator.AND, query);
Himanshu Sharma
answered Sep 1, 2015 by hs00105 (2,005 points)
Thanks , This helps ..
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on