Hello
I'm playing around with Parse, I've managed to create a cloud database with two classes/tables, Users and Posts, I'm able to register and login users and allow them to make posts to the database.
I'm now trying to work out how to query the database and get the data that has been posted, my Posts class/table is made up of four columns: | ObjectID | text | user | createdAt |.
I would like to be able to select and display in my app, all of the data held in the 'text' column. I have very little database experience so sorry if this is a stupid question.
Code so far:
ParseQuery<ParseObject> query = ParseQuery.getQuery("Posts");
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> text, ParseException e) {
if (e == null) {
Toast.makeText(MainActivity.this, text.toString(), Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(MainActivity.this, "query error: " + e, Toast.LENGTH_LONG).show();
}
}
});
I know that I need to constrain the query to only data from the 'text' column so I'm obviously missing a line of code between line 1 and 2.
Any help would be appreciated. Thanks.