1

我有一个最喜欢的类,它有一个指向名为 Location 的类的指针作为它的位置字段之一。我想查询 Favorite 类并检索指向某个 Location 对象的所有对象。在 javascript 中,我只是创建了一个 Location 对象,将 id 设置为我感兴趣的位置的 objectId 并查询最喜欢的位置,其中位置等于该对象。

但是在android中我无法设置objectId。同样将查询设置为 objctId 的字符串也不起作用。

// Something I would have expected existed
//ParseObject location = new ParseObject("Location");
//location.setObjectId(locationId);

final ParseQuery<ParseObject> query = ParseQuery.getQuery("Favorite");
// if I had the location object, but I only have the locationId
//query.whereEqualTo("location", location );

query.whereEqualTo("location", locationId);
query.findInBackground(...
4

1 回答 1

1
query.whereEqualTo("location",Parse.createWithoutData(reference_classname,ObjectId));
于 2017-03-21T06:09:07.300 回答