Consider a collection with JSON
{
"username": "9000000000",
"data": {
"id": 0,
"lastName": "kumar",
"sex": 1,
"email": "ram@kumar.co.in",
"firstName": "ram",
"mobile": "9000000000",
"city": "Mumbai"
},
"type": 1
}
I want to get such documents with
type==1 AND (mobile LIKE xyz OR email==xyz@gmail.com)
Query qEmail=QueryBuilder.build(ModelPhone.KEY_EMAIL, model.getEmail(), Operator.EQUALS);
Query qMobile=QueryBuilder.build(ModelPhone.KEY_MOBILE, "%"+model.getMobile(), Operator.LIKE);
Query qOR=QueryBuilder.compoundOperator(qEmail, Operator.OR, qMobile);
Query qFinal=QueryBuilder.compoundOperator(qType, Operator.AND, qOR);
Storage storage=getStorageService().findDocumentsByQuery(dbName, COLLECTION_USERDATA, qFinal);
Out Put:
getUserData() : com.shephertz.app42.paas.sdk.java.App42NotFoundException: {"app42Fault":{"httpErrorCode":404,"appErrorCode":2608,"message":"Not Found","details":"No document in the collection 'collection_userdata' exists for given query"}}
So how do I query Nested Data???