I have saved some data in the GAE datastore using Android Studio backend and I am able to see that in the datastore console. However, when I try to retrieve the data from the same backend in my app using queries, it is not returning anything at all. Also it is not throwing any error as well. Here is the code snippet which is supposed to retrieve the entities of kind "Match":
Date date=new Date();
Filter filter=new FilterPredicate("matchTime", FilterOperator.GREATER_THAN,date);
Query qry=new Query("Match").setFilter(filter);
PreparedQuery pq=datastoreService.prepare(qry);
List<Entity> entities=pq.asList(FetchOptions.Builder.withLimit(5));
Here is what I have already tried:
- Removed the filter and just used:Query qry=new Query("Match")
- Tried query using the parent key, even though in my understanding that should be a subset of the query without parent key.
In all cases I got just an empty List without any error. Please suggest what I am doing wrong here. The put operations I performed at different times worked just fine so must be something with the the query.