Why PFRelation does not support fromLocalDataStore queries?

放肆的年华 提交于 2019-11-30 10:08:49

I've created a bug report for this issue which is

escalated to the engineering team to investigate further

So it looks like it's a bug

In the meanwhile, I've converted all my PFRelations to arrays of pointers to related PFObjects. Not as fancy as PFRelation, but works fine with local data storage.

Update: parse solved the issue in Parse SDK v.1.7.3

It's a Parse bug. It can be also reproduced with Android SDK. I'm not sure on iOS, but on Android I have found a way how to make it work.

You need to have a Pointer in "related" classes to the ParseObject which has Relations.

In your case, you have a PFUser which has several PFRelations. If you add a PFPointer to your PFUser in "related" classes, query from the local datastore would work just fine.

Or for the case from my link above - If Comment class would have a Pointer to a Post class everything would work fine.

Have the same problem in parse 1.7.5 (release notes mentions that they fixed this bug, but still not working for me)

You can make it working with executing separate query for relation you have for each pinning object (maybe there is a way to do it with all objects at once?). And then pin results of relation query.

After that querying from local datastore starts working fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!