Welcome
Login
Sign up
Home
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
Android
How do I count the number of accessable entities in a collection?
j
jamesw6811
started a topic
over 4 years ago
I've tried using appdata.countBlocking(new ArrayList(), null).
I don't want to download all the entities because it takes too long.
6 Comments
Oldest First
Popular
Newest First
Sorted by
Newest First
C
Caroline
said
over 4 years ago
Hi James,
Glad you got it solved! You have a good point that including this in our guide would be helpful!
j
jamesw6811
said
over 4 years ago
Actually, problem not solved.
countBlocking sometimes returns a count of 1 and sometimes returns the correct count. Normally on the first call after login it is returning 1.
EDIT: This problem was solved -- I just am querying an incorrect data set due to other issues I've brought up in another question.
If you are looking to count the entities in your collection, look no further than:
http://www.zunisoft.com/2013/08/kinvey-simple-aggregates.html
j
jamesw6811
said
over 4 years ago
That said -- this very simple functionality should definitely be on the guide.
j
jamesw6811
said
over 4 years ago
I think I have this solved, I was not using .execute() -- please see the following link for a helpful tutorial:
http://www.zunisoft.com/2013/08/kinvey-simple-aggregates.html
j
jamesw6811
said
over 4 years ago
This bit of code:
ArrayList list = new ArrayList();
AsyncAppData.Aggregate res = entries.countBlocking(list, null);
Log.d(LOGTAG, "Amount of entries:"+res.toString());
is printing out
Amount of entries:{appKey=kid_Ve_dVjLrYi, collectionName=entries}
j
jamesw6811
said
over 4 years ago
Basically I'm trying to do a SQL COUNT(*)
Login
or
Signup
to post a comment
More topics in
Android
Can I add KinveyReferences and other custom Arrays to the User entity?
How can I use custom enums within my Entity?
Linking an image does not save with LinkedData
How can I get all records saved by the current user?
Why don't all users see the same data when querying?
Retrieving related file from datastore collection - continued
Problem implementing sign up / login
Can Android API be used for Java?
I'm not receiving push notifications
It is impossible to receive object according to the link
See all 252 topics
jamesw6811
I don't want to download all the entities because it takes too long.