bmob / bmob-android-sdk

Bmob Android SDK Repository
https://www.bmobapp.com/
123 stars 43 forks source link

问一下addWhereMatchesQuery 和 innerQuery #25

Open kingofswing opened 6 years ago

kingofswing commented 6 years ago

文档曰: 当查询的表为系统表(目前系统表有User、Installation、Role)时,需要带上下划线_。 比如,你想查询出用户smile和smile好友的所有帖子,则可以这样: BmobQuery<User> innerQuery = new BmobQuery<User>(); String[] friendIds={"ssss","aaaa"};//好友的objectId数组 innerQuery.addWhereContainedIn("objectId", Arrays.asList(friendIds)); //查询帖子 BmobQuery<Post> query = new BmobQuery<Post>(); query.addWhereMatchesQuery("author", "_User", innerQuery); query.findObjects(new FindListener<Post>() { @Override public void done(List<Post> object,BmobException e) { if(e==null){ Log.i("bmob","成功"); }else{ Log.i("bmob","失败:"+e.getMessage()); } } }); 从字面上来看,那个innerQuery,好像只有好友的ojectId数组,体现查询出smile本人的帖子,是哪个语句实现的? 【比目官方人员:2018-05-18 14:24:21 #1 回复:查询出 smile的帖子外加 smile好友的帖子】 但是我看不出来哪里查了smile本人的帖子。请教