2

我有一类“工作”对象——都与 UserProfile 类有关。我想查询与本地用户相关的工作对象。这就是我这样做的原因:

Where<Work> where = new Where<>();
where.eq(Work.FIELD_USERIDID, UserProfile.FIELD_ID, userProfile.getId());
Syncano.getInstance().getObjects(Work.class).setWhereFilter(where).sendAsync(callback);

我得到:

Response{resultCode=1, httpResultCode=400, error='{"query":"Field userProfile cannot be used in a query as it is not indexed."}', httpReasonPhrase='Bad Request', data=null}

查询与 UserProfile 相关的类并且我只想要与特定 UserProfile 相关的对象的正确方法是什么?

4

1 回答 1

2

哦,这很快。您需要在此字段上启用字段过滤(通过代码(注释)或 Web 仪表板)。 http://docs.syncano.io/docs/android#section-fields-filtering http://docs.syncano.io/docs/data-objects-filtering

于 2016-03-01T12:57:24.293 回答