我有Disk Out of Space
和User
Class with parse。
我在GroupMember
类中添加了一个User
指针列,希望从GroupMember
类中获取所有用户,但不包括User
类关系中存在的用户。< / p>
答案 0 :(得分:1)
您需要进行两个查询,从objectId
指针列查询所有用户GroupMember
,然后从User
类的下一个查询中排除这些对象。
ParseQuery<ParseObject> a = ParseQuery.getQuery("GroupMember");
a.include("name of pointer column")
a.findInBackground(new FindCallback...); // get list of objects id with for each loop
//i.e. for (ParseObject o : list) String s = o.getParseObject("user_pointer_column").getObjectId();
//then add it to some list
ParseQuery<ParseObject> b = ParseQuery.getQuery("User");
b.whereNotContainedIn("objectId", list_of_ids);
或者另一种方式:
ParseQuery<ParseObject> a = ParseQuery.getQuery("User");
ParseQuery<ParseObject> b = ParseQuery.getQuery("GroupMember");
b.whereDoesNotMatchQuery("user_pointer_column", a);
b.findInBackground(new FindCallback...{...});