user986047
user986047

Reputation: 79

Queries with empty values from parse.com

Somehow I couldn't find the answer to this.

I am running a query to parse.com and want to download all of the rows that contain an empty value in one of my columns.

 ParseQuery<ParseObject> query = ParseQuery.getQuery(Constants.myTestTable);
    query.whereEqualTo("MyColumn", "");

When I upload a csv to parse where MyColumn does not have any value the column cells on parse show "(undefined)" and I cannot retrieve the data. However, when I delete all content in the cell I am able to retrieve it. I want to be able to retrieve the data if the cell has the default "(undefined)" value from parse. I tried...

ParseQuery<ParseObject> query = ParseQuery.getQuery(Constants.myTestTable);
        query.whereEqualTo("MyColumn", null);

But that did not work either. I'm sure there is an easy solution to this, I just can't get the dang thing to work.

Upvotes: 2

Views: 2742

Answers (1)

Timothy Walters
Timothy Walters

Reputation: 16874

What you want are whereExists and whereDoesNotExist.

query.whereDoesNotExist("MyColumn");

Upvotes: 10

Related Questions